Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github Action triggered on push tag, does trigger after deleting tag and pushing again but will use old version of code

I have a github action definition that builds + tests my node project.

I have set it to trigger this way:

on:
  push:
    tags:
      - '*'

And it works, but the issue is, sometimes builds fail and I don't want to release a new version + tag on every fail. So I thought I'd just delete the tag using:

git push --delete origin v1.0.0

and then simply pushing again.

This work and the pipeline gets triggered. However, a test was failing due to having too low of a timeout (actually receiving data from a remote) The timeout was 5000ms and I tried changing it to 15000ms with this method for ~8 commits and even though I didn't have 5000 nowhere in my app, it still threw the same timeout error.

I have decided to create a new version with the same files and the error went away as the timeout was sufficient, which made me realize that it was still using the old version of the file.

My questions are:

  • Is this a bug or a feature?
  • What options do I have when my pipeline fails and it triggers on tags?
  • Is there another way of managing tags when using them to track version/releases and trigger pipelines? Such as, trigger on commits with tags and not on tag creation? If yes, how can I assign tags to a commit? I have yet to find an answer to this.

Thank you.

like image 427
SebastianG Avatar asked Nov 07 '22 12:11

SebastianG


1 Answers

It will pickup the tag creation related to the previous commit due to not deleting the local tag, it doesn't matter  that you've made more commits since then, if you want to trigger it again, delete both remote and local tags, then recreate the tag locally and push with follow tags again.

like image 61
Kyle Popoviciu Avatar answered Nov 15 '22 12:11

Kyle Popoviciu