Replies: 7 comments 3 replies
-
|
Hi there @jdolitsky and welcome to our community! Thank you for the feedback! |
Beta Was this translation helpful? Give feedback.
-
|
That would be totally helpful because now you need to do a lot of magic to get the numeric job id (as shown in the URL). |
Beta Was this translation helpful? Give feedback.
-
|
There is a github action that does exactly this, and also outputs the full html_url as it is returned from the GitHub API: https://github.com/marketplace/actions/github-actions-job_id-parser |
Beta Was this translation helpful? Give feedback.
-
|
I was using |
Beta Was this translation helpful? Give feedback.
-
|
Haven't tested, but what you need might available now as Although it can only be used in the execution steps, so it can't be used as a fallback value for the concurrency key. |
Beta Was this translation helpful? Give feedback.
-
|
Feel free to use my action to access current Example Workflow jobs:
example:
runs-on: ubuntu-latest
environment: playground
permissions:
actions: read # required for qoomon/actions--context action
deployments: read # required for qoomon/actions--context action
contents: read
steps:
- uses: qoomon/actions--context@v1
id: context
- run: |
echo "Current Environment: ${{ steps.context.outputs.job }}"
echo "Current Environment: ${{ steps.context.outputs.environment }}"
echo "Job Logs: ${{ steps.context.outputs.job_log_url }}" |
Beta Was this translation helpful? Give feedback.
-
|
Why is this still not a thing? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Product Feedback
Body
Please see the following Stack Overflow post for more context: https://stackoverflow.com/questions/71240338/obtain-job-id-from-a-workflow-run-using-contexts
When running a job using matrix strategy, if an individual leg of the matrix fails, I would like to obtain a link to the failed leg.
This is available through the GitHub API. When querying an action run, you can loop through the jobs and check for one which has a matching
name, then extract thehtml_urlfield.It would be ideal to be able to get this using syntax such as
${{ github.job.id }}. This could then be used to contruct the html URL manually using something like:Beta Was this translation helpful? Give feedback.
All reactions