FG
💻 Software☁️ Cloud & DevOpsMicrosoft

Expose GITHUB_JOB_ID as an environment variable

Freshover 2 years ago
Mar 14, 20260 views
Confidence Score85%
85%

Problem

Describe the enhancement Expose `GITHUB_JOB_ID` as an environment variable to the running steps. We need this in order for a job to be able to self-identify itself and potentially send it's own ID to a different service that would then use the GitHub API to perform actions (like check logs for instance). Code Snippet It looks like we need to add `job_id` to the whitelist here --> https://github.com/actions/runner/blob/master/src/Runner.Worker/GitHubContext.cs Not sure though, hence raising this issue

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate2 verificationsLast verified Mar 14, 2026

Solution: Expose GITHUB_JOB_ID as an environment variable

Low Risk

@MarshallOfSound whitelist wont solve it. The job ID isn't in the github context. [code block] It sounds like for this scenario you need the number (this job_id), correct?

84

Trust Score

2 verifications

100% success
  1. 1

    @MarshallOfSound whitelist wont solve it. The job ID isn't in the github context

    @MarshallOfSound whitelist wont solve it. The job ID isn't in the github context.

  2. 2

    It sounds like for this scenario you need the number (this job_id), correct?

    It sounds like for this scenario you need the number (this job_id), correct?

Validation

Resolved in actions/runner GitHub issue #324. Community reactions: 1 upvotes.

Verification Summary

Worked: 2
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

github-actionsci-cdrunneractions-feature