Skip to content

Matrix jobs with titles longer than 100 characters can't find their job_id #482

@karolba

Description

@karolba

First of all, thank you for this great project!

Describe the bug

Matrix jobs with titles longer than 100 characters can't find their job_id, because GitHub is truncating the job title.

Image

This truncation sadly also happens through the API:

$  gh api /repos/karolba/tf-via-pr-repro/actions/runs/16523799334/attempts/1/jobs | jq '.jobs[].name'
"test (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..."

To Reproduce

Something like this:

on:
  workflow_dispatch:
    inputs:
      matrix-parameter:
        description: '...'
        type: string
        required: true

jobs:
  test:
    runs-on: ubuntu-latest

    permissions:
      actions: read
      checks: write
      contents: read
      pull-requests: write

    strategy:
      matrix:
        include:
          - value: ${{ inputs.matrix-parameter }}

    steps:
      - uses: actions/checkout@v4

      - uses: hashicorp/setup-terraform@v3
        with:
          terraform_wrapper: false

      - uses: op5dev/tf-via-pr@v13
        with:
          working-directory: .
          command: init
          arg-backend: false

Succeeded run, a short title: https://github.com/karolba/tf-via-pr-repro/actions/runs/16523783785/job/46731746350
Failed run, a long truncated title: https://github.com/karolba/tf-via-pr-repro/actions/runs/16523799334/job/46731800838

Screenshots

Image

Additional context

I could provide a PR fixing this but I'm not sure it's really possible with how the GitHub API currently works. I've found this approach: https://github.com/qoomon/actions--context/blob/486c37d6b227e8f01d8694a92e89d88b6c454281/lib/actions.ts#L235-L294 that makes use of .jobs[].runner_name having semi-unique names (they look like "GitHub Actions 1000000072" for GitHub-hosted runners).

This seems like a good idea, however I have no idea this value would also be unique for all setups with self-hosted runners.

I did check some jobs based on runs-on.com runners I have access to and this seems to hold though:

$ gh api /repos/[...]/[...]/actions/runs/[...]/attempts/1/jobs | jq '.jobs[].runner_name'
"GitHub Actions 1000023117"
"runs-on--i-0ace19af4d869a39e--AkrIiniYYc"
"GitHub Actions 1000023118"
"runs-on--i-061f5900650d83914--mYSLfAOwJN"
"runs-on--i-096e31255c6fec8d5--NZwDVaXmgC"
"runs-on--i-07aa7ff96b9ecd616--vlHoMysSsQ"
"runs-on--i-0bb3438f22f065b97--DtQDPCJSTg"
"runs-on--i-04f2a9668d2ffdd06--OztLfCgeCJ"
"runs-on--i-031f9c288d61ff213--ZjBHjPDrSC"
"runs-on--i-0d9d1a48bece2f80d--GCXbgXsQBT"
"runs-on--i-09771e51b1002c522--XhtuJQeLtM"
"runs-on--i-05fee9d31716c2970--ZYcCScojku"
"runs-on--i-0f8d9a0becf75deda--qSXeEGvhyf"
"runs-on--i-07b156e010a3ef8eb--SiskFvGdQv"
"GitHub Actions 1000023124"
"GitHub Actions 1000023125"

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions