Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get current job name in Github Actions workflow

I want to reference the running job name in one of its steps. These are the options Github gives us: https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#job-context. The closer one I see is "job.container.id". Would that give me the name I set to the job? It doesn't sound like it. Unfortunately, I can't no longer test this since I exceeded the limit of free Github Actions usage

like image 647
GabrielBB Avatar asked May 05 '20 11:05

GabrielBB


People also ask

How do I find my job ID in GitHub Actions?

job getting the key. get list of jobs for a workflow using API: /repos/{owner}/{repo}/actions/runs/{run_id}/jobs. find the job by the name and get id as int value.

What is jobs in GitHub Actions?

Each job will run inside its own virtual machine runner, or inside a container, and has one or more steps that either run a script that you define or run an action, which is a reusable extension that can simplify your workflow.

What is ref in GitHub Actions?

github.ref. string. The fully-formed ref of the branch or tag that triggered the workflow run. For workflows triggered by push , this is the branch or tag ref that was pushed. For workflows triggered by pull_request , this is the pull request merge branch.

How do I get action tags in GitHub?

to tag a commit. push the tag to trigger the github action. github action sets the git tag as an env var. run install & build.


1 Answers

github.job might get you the job name

enter image description here

like image 120
Chandan Gupta Avatar answered Oct 02 '22 00:10

Chandan Gupta