Skip to content

beacon-biosignals/job-context

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Job Context

Provides additional context for the currently running job. GitHub Actions provides a job context but is missing some pieces including the job name and the job ID (the numeric value as used by the GitHub API).

Requirements

The job-context action requires that the job in which this action is used has a job name that is unique within the workflow file. By default job names are unique so this is only a problem if you specify a custom jobs.<job_key>.name. If the job name is not unique within the workflow this action will fail and report the ambiguous job name.

Additionally, this job currently does not support job names which utilize GHA expressions using the contexts: needs, vars, or inputs.

Examples

# CI.yaml
jobs:
  demo:
    name: Demo
    # These permissions are needed to:
    # - Use `job-context`: https://github.com/beacon-biosignals/job-context#permissions
    permissions:
      context: read
    runs-on: ubuntu-latest
    strategy:
      matrix:
        version:
          - "1.0"
          - "2.0"
    steps:
      - uses: beacon-biosignals/job-context@v1
        id: job
      - run: |
          echo "job-name=${{ steps.job.outputs.name }}  # e.g. Demo (1.0)
          echo "job-id=${{ steps.job.outputs.id }}      # e.g. 28842064821

Inputs

The job-context action does not support any inputs.

Outputs

Name Description Example
name The rendered job name.
Demo (1.0)
id The numeric job ID as used by the GitHub API. Not be be confused with the workflow job key github.job.
28842064821

Permissions

The follow job permissions are required to run this action:

permissions:
  context: read