Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
box

GitHub Action

Enhanced Job Context

v2.0.1

Enhanced Job Context

box

Enhanced Job Context

Get additional job context information

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Enhanced Job Context

uses: qoomon/[email protected]

Learn more about this action in qoomon/actions--context

Choose a version

Enhanced Job Context   Actions

This action provides an enhanced job context for GitHub Actions.

Usage

Important

For usage within a reusable workflow, see Usage within Reusable Workflows

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@v2
        id: context

      - run: |
          echo "Current Environment: ${{ steps.context.outputs.environment }}"
          echo "Job Logs: ${{ steps.context.outputs.job_log_url }}"

Outputs

outputs:
  job:
    description: The workflow job name of the current job.
  job_id:
    description: The workflow run job id of the current job.
  job_log_url:
    description: The HTML url of the job log for the current job.

  run_id:
    description: The workflow run id of the current job.
  run_attempt:
    description: The workflow run attempt of the current job.
  run_number:
    description: The workflow run number of the current job. Same as `github.run_number`.

  environment:
    description: The environment of the current job.
  environment_url:
    description: The environment HTML url of the current job.

  deployment_id:
    description: The deployment id of the current job.
  deployment_url:
    description: The deployment HTML url of the current job.
  deployment_workflow_url:
    description: The deployment workflow HTML url of the current job.
  deployment_log_url:
    description: The deployment log HTML url of the current job.

Usage within Reusable Workflows

Main Workflow
jobs:
  reusable-job:
    permissions:
      actions:     read  # required for qoomon/actions--context action
      deployments: read  # required for qoomon/actions--context action
      contents: read
    strategy:
      matrix:
        node-version: [ 22.x, 20.x ]
    uses: ./.github/workflows/example-reusable.yml
    with:
      # IMPORTANT ensure first value match the surrounding job name
      # IMPORTANT If the surrounding workflow is a reusable workflow itself, append ', ${{ inputs.workflow-context }}'
      workflow-context: '"reusable-job", ${{ toJSON(matrix) }}'
Reusable workflow
on:
  workflow_call:
    inputs:
      workflow-context:
        type: string

jobs:
  build:
    runs-on: ubuntu-latest
    permissions:
      actions:     read  # required for qoomon/actions--context action
      deployments: read  # required for qoomon/actions--context action
      contents: read
    steps:
      - uses: qoomon/actions--context@v2
        id: context
        with:
          workflow-context: '${{ inputs.workflow-context }}'

      - run: |
          echo "Current Environment: ${{ steps.context.outputs.environment }}"
          echo "Job Logs: ${{ steps.context.outputs.job_log_url }}"

Release New Action Version

  • Trigger the Release workflow
    • The workflow will create a new release with the given version and also move the related major version tag e.g. v1 to point to this new release