Skip to content

Commit

Permalink
Fix job_id, url being "null" in ci.json if run has >30 jobs
Browse files Browse the repository at this point in the history
See <Tiryoh/gha-jobid-action#1>: the
`Tiryoh/gha-jobid-action` action currently uses GitHub REST API to fetch
all jobs for the given workflow run, but it only processes the first
page and the default `per_page` is 30.

For the record, currently the most recent workflow run
<https://github.com/kaitai-io/ci_targets/actions/runs/5696726848> has 39
jobs, so there were 9 jobs which weren't in the first 30 jobs returned
by the GitHub REST API, which caused both output variables `job_id` and
`html_url` to be `"null"`. The 9 jobs were the following:

* perl/5.38-linux-x86_64	<https://github.com/kaitai-io/ci_artifacts/blob/8fc6a313ec238507536e4185fcbeb995bc94f389/test_out/perl/ci.json#L9-L10>
* php/7.1-linux-x86_64	<https://github.com/kaitai-io/ci_artifacts/blob/9bba3f500ebe1e3911d6056fcafde17c6c2ca1a2/test_out/php/ci.json#L9-L10>
* php/8.2-linux-x86_64	<https://github.com/kaitai-io/ci_artifacts/blob/ed0e41f1958b4ac2e8bbfbca87cf655e7fb84bbd/test_out/php/ci.json#L9-L10>
* python/2.7-linux-x86_64	<https://github.com/kaitai-io/ci_artifacts/blob/1e8512d15e2a1f8f370e50bebd9909645aee0cbc/test_out/python/ci.json#L9-L10>
* python/3.4-linux-x86_64	<https://github.com/kaitai-io/ci_artifacts/blob/d98d51959c4c7edd805f7964d6bb84aadeed3cc2/test_out/python/ci.json#L9-L10>
* python/3.11-linux-x86_64	<https://github.com/kaitai-io/ci_artifacts/blob/2d177a43e526d2caf26a8808c1796e6b87c12a3e/test_out/python/ci.json#L9-L10>
* ruby/1.9-linux-x86_64	<https://github.com/kaitai-io/ci_artifacts/blob/47791f7a6830511c1958b35294f2b26314e6ccb0/test_out/ruby/ci.json#L1163-L1164>
* ruby/2.3-linux-x86_64	<https://github.com/kaitai-io/ci_artifacts/blob/bb2faa914d31ac8271125c1e10a4cca8cd527d7c/test_out/ruby/ci.json#L9-L10>
* ruby/3.2-linux-x86_64	<https://github.com/kaitai-io/ci_artifacts/blob/0d46fe1d3be4067d871090a7f1056ddab9eb73d1/test_out/ruby/ci.json#L9-L10>
  • Loading branch information
generalmimon committed Aug 2, 2023
1 parent b31815f commit 87a5b95
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ jobs:
with:
github_token: ${{github.token}}
job_name: "${{github.job}} (${{matrix.tsv.target}}, ${{matrix.tsv.implementation}}, ${{matrix.tsv.dotnet}})"
# This is needed if there are more than 30 jobs in the workflow run,
# see https://github.com/Tiryoh/gha-jobid-action/issues/1
per_page: 100
- name: prepare
run: |
git clone --depth 1 https://github.com/kaitai-io/kaitai_struct_tests tests
Expand Down Expand Up @@ -307,6 +310,9 @@ jobs:
with:
github_token: ${{github.token}}
job_name: "${{github.job}} (${{matrix.tsv.target}}${{ format('{0}', matrix.tsv.subtarget) != '' && format(', {0}', matrix.tsv.subtarget) || '' }}, ${{matrix.tsv.implementation}})"
# This is needed if there are more than 30 jobs in the workflow run,
# see https://github.com/Tiryoh/gha-jobid-action/issues/1
per_page: 100

- name: run tests
env:
Expand Down

0 comments on commit 87a5b95

Please sign in to comment.