-
Hi! I’m trying to create a workflow for deployment, and I’d like to create a deploy status and submit the url to the log of the action that deployed. Very handy if the deply failes I think. Using actions/bin/debug I can’t seem to find any reference to the id of the run or url to the run. Is there a way to extract this in some way? |
Beta Was this translation helpful? Give feedback.
Replies: 18 comments 4 replies
-
We don’t currently expose that information, however I’ve made a note of this feedback so we can take it into account as we continue to improve actions. |
Beta Was this translation helpful? Give feedback.
-
Thanks! It would perhaps be great to have it as one of the environment variables. GITHUB_RUN_ID or something along those lines. |
Beta Was this translation helpful? Give feedback.
-
I have similar use case. Would be nice to have this. |
Beta Was this translation helpful? Give feedback.
-
Any updates on this now with the launch of CI/CD support? Exposing the run ID would be really helpful for supporting parallelization for Cypress users. |
Beta Was this translation helpful? Give feedback.
-
I was just trying to solve this problem recently, this is what I ended up with in the mean time to just set the deployment url: https://github.com/deliverybot/status/blob/master/index.js#L7 |
Beta Was this translation helpful? Give feedback.
-
@mcolyer has there been any movement on this item? |
Beta Was this translation helpful? Give feedback.
-
As requested in https://github.community/t5/GitHub-Actions/Check-Suite-identifier-as-an-environment-variable/m-p/35498#M2240, having GITHUB_CHECK_SUITE_ID would allow provision of such URL as follow:
|
Beta Was this translation helpful? Give feedback.
-
Hi @mcolyer Another example would be, if I want to send a Slack message with a link to my GitHub Actions run in case if it sucessed, failed or canceled, I want a varible that points to:
Best Wishes,
|
Beta Was this translation helpful? Give feedback.
-
With the new Actions API, there are now $GITHUB_RUN_ID environment variable provided. Using it, a URL to the workflow could be constructed as follows:
|
Beta Was this translation helpful? Give feedback.
-
Does that actually work for you? My run IDs are different than the numbers in the URLs. And using the run ID like that results in a 404. Edit: Aha! I’m wrong. There’s |
Beta Was this translation helpful? Give feedback.
-
Formatting got weird there—sorry. |
Beta Was this translation helpful? Give feedback.
-
Does anyone know how to get that URL for the current job in the current run? |
Beta Was this translation helpful? Give feedback.
-
Yeah! It would be great to have the id of the current job to be able to construct a link for that too! Currently, this is not possible. |
Beta Was this translation helpful? Give feedback.
-
I think this should do it @dominikfoldi @samuela We are currently using it in our action for updating the deployment status https://github.com/unacast/actions-github-deployment-status/blob/d6be60b7d328f52d8a329119f39add23737be3da/bin/deployment-create-status#L14 |
Beta Was this translation helpful? Give feedback.
-
No. That will link to the workflow run which has one or more jobs. The jobs have their own dedicated ids, so they have their own links, too. |
Beta Was this translation helpful? Give feedback.
-
Ah, sorry. Then I understand. And I don’t know. |
Beta Was this translation helpful? Give feedback.
-
The job run IDs don’t seem to be exposed in actions, at least per the documentation. Might be worth to print all contexts etc. to check whether this information is available but undocumented. Other than that, you may use the API to get the job
Actions - GitHub Docs |
Beta Was this translation helpful? Give feedback.
-
This shows an existing run, is it possible to create a hyperlink that will create a new run when clicked? |
Beta Was this translation helpful? Give feedback.
With the new Actions API, there are now $GITHUB_RUN_ID environment variable provided.
Using it, a URL to the workflow could be constructed as follows: