Github Actions url to run

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?

12 Likes

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.

11 Likes

Thanks! It would perhaps be great to have it as one of the environment variables. GITHUB_RUN_ID or something along those lines.

9 Likes

I have similar use case. Would be nice to have this.

2 Likes

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.

4 Likes

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

1 Like

@mcolyer has there been any movement on this item?

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:

GITHUB_WORKFLOW_URL=https://github.com/$GITHUB_REPOSITORY/commit/$GITHUB_SHA/checks?check_suite_id=$GITHUB_CHECK_SUITE_ID
1 Like

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:

https://github.com/{account-name}/{repository-name}/commit/{git-sha}/checks?check_suite_id={run-id}

Best Wishes,

  • Oleg
7 Likes

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: 

GITHUB_WORKFLOW_URL=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID

Щіро Вам дякую,і налоштовуємося на співпрацю,і врю в успіх співпраці.

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 \<repo\>/actions/runs/\<id\> that shows all the jobs and \<repo\>/runs/\<some-other-number\> once you start clicking into jobs. The first one works as you say. My mistake!