Skip to content

RUNNER_NAME and /repos/{owner}/{repo}/actions/runs/{run_id}/jobs are incorrectly documented #37046

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
jsoref opened this issue Mar 23, 2025 · 3 comments
Open
1 task done
Labels
content This issue or pull request belongs to the Docs Content team needs SME This proposal needs review from a subject matter expert

Comments

@jsoref
Copy link
Contributor

jsoref commented Mar 23, 2025

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables

What part(s) of the article would you like to see updated?

https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables

Variable Description
RUNNER_NAME The name of the runner executing the job. This name may not be unique in a workflow run as runners at the repository and organization levels could use the same name. For example, Hosted Agent

https://docs.github.com/en/rest/actions/workflow-jobs?apiVersion=2022-11-28#list-jobs-for-a-workflow-run

example response
{
  "total_count": 1,
  "jobs": [
    {
      "id": 399444496,
      "run_id": 29679449,
      "run_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/29679449",
      "node_id": "MDEyOldvcmtmbG93IEpvYjM5OTQ0NDQ5Ng==",
      "head_sha": "f83a356604ae3c5d03e1b46ef4d1ca77d64a90b0",
      "url": "https://api.github.com/repos/octo-org/octo-repo/actions/jobs/399444496",
      "html_url": "https://github.com/octo-org/octo-repo/runs/29679449/jobs/399444496",
      "status": "completed",
      "conclusion": "success",
      "started_at": "2020-01-20T17:42:40Z",
      "completed_at": "2020-01-20T17:44:39Z",
      "name": "build",
      "steps": [
        {
          "name": "Set up job",
          "status": "completed",
          "conclusion": "success",
          "number": 1,
          "started_at": "2020-01-20T09:42:40.000-08:00",
          "completed_at": "2020-01-20T09:42:41.000-08:00"
        },
        {
          "name": "Run actions/checkout@v2",
          "status": "completed",
          "conclusion": "success",
          "number": 2,
          "started_at": "2020-01-20T09:42:41.000-08:00",
          "completed_at": "2020-01-20T09:42:45.000-08:00"
        },
        {
          "name": "Set up Ruby",
          "status": "completed",
          "conclusion": "success",
          "number": 3,
          "started_at": "2020-01-20T09:42:45.000-08:00",
          "completed_at": "2020-01-20T09:42:45.000-08:00"
        },
        {
          "name": "Run actions/cache@v3",
          "status": "completed",
          "conclusion": "success",
          "number": 4,
          "started_at": "2020-01-20T09:42:45.000-08:00",
          "completed_at": "2020-01-20T09:42:48.000-08:00"
        },
        {
          "name": "Install Bundler",
          "status": "completed",
          "conclusion": "success",
          "number": 5,
          "started_at": "2020-01-20T09:42:48.000-08:00",
          "completed_at": "2020-01-20T09:42:52.000-08:00"
        },
        {
          "name": "Install Gems",
          "status": "completed",
          "conclusion": "success",
          "number": 6,
          "started_at": "2020-01-20T09:42:52.000-08:00",
          "completed_at": "2020-01-20T09:42:53.000-08:00"
        },
        {
          "name": "Run Tests",
          "status": "completed",
          "conclusion": "success",
          "number": 7,
          "started_at": "2020-01-20T09:42:53.000-08:00",
          "completed_at": "2020-01-20T09:42:59.000-08:00"
        },
        {
          "name": "Deploy to Heroku",
          "status": "completed",
          "conclusion": "success",
          "number": 8,
          "started_at": "2020-01-20T09:42:59.000-08:00",
          "completed_at": "2020-01-20T09:44:39.000-08:00"
        },
        {
          "name": "Post actions/cache@v3",
          "status": "completed",
          "conclusion": "success",
          "number": 16,
          "started_at": "2020-01-20T09:44:39.000-08:00",
          "completed_at": "2020-01-20T09:44:39.000-08:00"
        },
        {
          "name": "Complete job",
          "status": "completed",
          "conclusion": "success",
          "number": 17,
          "started_at": "2020-01-20T09:44:39.000-08:00",
          "completed_at": "2020-01-20T09:44:39.000-08:00"
        }
      ],
      "check_run_url": "https://api.github.com/repos/octo-org/octo-repo/check-runs/399444496",
      "labels": [
        "self-hosted",
        "foo",
        "bar"
      ],
      "runner_id": 1,
      "runner_name": "my runner",
      "runner_group_id": 2,
      "runner_group_name": "my runner group",
      "workflow_name": "CI",
      "head_branch": "main"
    }
  ]
}
      "runner_name": "my runner",

https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#runner-context

Property name Type Description
runner.name string The name of the runner executing the job. This name may not be unique in a workflow run as runners at the repository and organization levels could use the same name.

Additional information

Between https://github.com/check-spelling-sandbox/check-spelling/actions/runs/13813316120 and https://github.com/check-spelling-sandbox/check-spelling/actions/runs/13835035831 the behavior of RUNNER_NAME and the github runner api changed.

In the first run, RUNNER_NAME and runner_name had matching behavior. In the second run, RUNNER_NAME is equivalent to runner_name (with spaces changed to _...) + "_" + runner_id.

Note that there is no id property in the runner context and that the runner context name now appears to include a runner id (at least for github hosted runners).

@jsoref jsoref added the content This issue or pull request belongs to the Docs Content team label Mar 23, 2025
@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Mar 23, 2025
@jsoref
Copy link
Contributor Author

jsoref commented Mar 23, 2025

For my reference, I added code to handle this change:
check-spelling/check-spelling@75e8f6b

which results in things working again:
https://github.com/check-spelling/check-spelling/actions/runs/14014671669/attempts/1#summary-39238824999

Note that nothing mentions that some of these things mangle spaces into -s either...

@Sharra-writes Sharra-writes added needs SME This proposal needs review from a subject matter expert and removed triage Do not begin working on this issue until triaged by the team labels Mar 25, 2025
Copy link
Contributor

Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert 👀

@Sharra-writes
Copy link
Contributor

@jsoref Thanks so much for opening a PR! I'll see if one of our SMEs can take a look.

@Sharra-writes Sharra-writes reopened this Apr 2, 2025
@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Apr 2, 2025
@Sharra-writes Sharra-writes removed the triage Do not begin working on this issue until triaged by the team label Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content This issue or pull request belongs to the Docs Content team needs SME This proposal needs review from a subject matter expert
Projects
None yet
Development

No branches or pull requests

3 participants
@jsoref @Sharra-writes and others