Add build number? #26689
-
First, just because other CI providers have a feature doesn’t necessarily mean that it should be implemented in Actions. That said, it would be very helpful to have a build number, or maybe even a build.job number, similar to Travis. Recently I wanted to look over the results of several builds, and there is no easy way to determine what is what (or what the order was). If the ‘number’ appeared early in the html title, one could see it on the browser tab, which is very helpful… |
Beta Was this translation helpful? Give feedback.
Replies: 18 comments 1 reply
-
Hello @msp-greg, Though I can’t guarantee anything or share a timeline for this, I can tell you that it’s been shared with the appropriate teams for consideration. |
Beta Was this translation helpful? Give feedback.
-
I’ve been using the build number as part of my version numbers (yyyy.m.d.build) which makes it easy to know when the deployment happened, and which build it’s from. This is one of the last things stopping me from moving all of my builds over to actions. |
Beta Was this translation helpful? Give feedback.
-
I have posted the same thing here over on the GitHub actions/toolkit repo as an issue as I am stil unsure where the best place is to discuss with the GitHub team and give feedback. Is it on issuses or here in this forum? |
Beta Was this translation helpful? Give feedback.
-
Thanks @xt0rted and @warrenbuckley for being here! This is the right place for this type of feedback as the team who directly works in actions is here and interacts with users. I can tell you that although as you know this is not available as yet, there is an internal discussion to add this feature to GitHub Actions and your feedback has been added to it. |
Beta Was this translation helpful? Give feedback.
-
CI build ID would be helpful. I recently added integration for GitHub Actions into my ruby gem knapsack_pro for automated tests split across parallel jobs. The CI build ID is needed to allow to run a few CI build at the same time for the same git commit. Here is more about my integration with GitHub Actions |
Beta Was this translation helpful? Give feedback.
-
I’ve made a simple action to generate sequential build numbers, https://github.com/einaregilsson/build-number . Would love for it to be made obsolete by GitHub implementing this natively, but until then I use it so I can continue the same versioning scheme I used on my old CI/CD system. I don’t think there’s any way right now to make the build number appear in the list of workflow runs though, that would be great if that was possible. |
Beta Was this translation helpful? Give feedback.
-
I think having |
Beta Was this translation helpful? Give feedback.
-
Looking forward for this implementation. |
Beta Was this translation helpful? Give feedback.
-
Here is my workaround using pushed time for build number.
|
Beta Was this translation helpful? Give feedback.
-
Here is our solution to this issue: https://medium.com/attest-engineering/adding-a-unique-github-build-identifier-7aa2e83cadca |
Beta Was this translation helpful? Give feedback.
-
On the github context there’s now a run_id and run_number property that’s available to be passed into your actions. I’m not sure if you can get to this from one of the environment variables, but it’s available through the context at least. There doesn’t seem to be docs on this yet but you can see it if you dump the context out like so:
run_id is the unique id of each run run_number looks to be an auto incrementing value specific to each workflow. This value doesn’t increment if you rerun the workflow. |
Beta Was this translation helpful? Give feedback.
-
Is this not what $GITHUB_RUN_NUMBER is for? |
Beta Was this translation helpful? Give feedback.
-
Both are also available as environment variables. |
Beta Was this translation helpful? Give feedback.
-
Great! exp. Thanks |
Beta Was this translation helpful? Give feedback.
-
The 2 env variables that were introduced are still not unique 😦 The number does not change if you re-run the workflow run.
When someone reruns workflow I need to run a new split of tests between parallel jobs in knapsack pro tool on Github Actions. If I would use GITHUB_RUN_ID and someone reruns the workflow then my API would assume tests were already split for this GITHUB_RUN_ID. I would need GITHUB_UNIQUE_RUN_ID that would be always unique even for re-run workflow. This is how most CI providers generate CI build ID (it should be unique). Any chance you would introduce GITHUB_UNIQUE_RUN_ID ? Thank you. |
Beta Was this translation helpful? Give feedback.
-
I could use something like that as well: services such as coveralls accept a unique job id in their input and it would be good if they could link back to the specific job that generated the coverage. |
Beta Was this translation helpful? Give feedback.
-
Hope I won’t jinx it, but it looks like this might finally get implemented: No, there's no reason why that isn't available. This is a very sensible request ... | Hacker News :slight_smile: |
Beta Was this translation helpful? Give feedback.
-
See |
Beta Was this translation helpful? Give feedback.
Both are also available as environment variables.
https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables