You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use Actions API to retrieve job run logs as a fallback mechanism #11169
We want to use the Actions API (here) as a fallback mechanism to retrieve job run logs when the current approach (extracting logs from a downloaded ZIP archive) fails.
Other context
If there's 1 job log missing, there are probably others, but fixing that holistically is a larger conversation with the Actions team.
It's common for projects to have a lot of logs for matrix workflows.
As a middle ground to avoid hitting the API too many times in case of huge runs (lots of jobs), we need to apply a restriction on the number of fallback API calls, and display an actionable error message to users.
Acceptance Criteria
1. Fallback to API call
Given I have a job run that is missing from the downloaded ZIP archive When I run gh run view --log -j <JOB-RUN-ID> Then I see the job logs, with the step name column filled with "UNKNOWN STEP"
Note
Reproducing this with read data is a bit tricky. Since this fix coincidentally fixes the cases reported in #10868, we can also use those cases to verify the current PR.
2. Error when too many API calls are needed
Given I have a workflow run where more than 25 job log files are missing from the downloaded ZIP archive When I run gh run view --log <RUN-ID> Then I get an error indicating I should use the --job option (without any API calls being made)
@babakks We are on the latest version 2.75.0 where this issue is fixed, but we are still seeing this. gh --version gh version 2.75.0 (2025-07-09) https://github.com/cli/cli/releases/tag/v2.75.0
We have a job skipped due to the conditionals. Does this handles that case ?
Currently it is failing with the error:
gh --repo abcd/xyz run view 16266528487 --log
...
...
log not found: 45923553930
45923553930 --> This corresponds to the skipped job id
Thanks @babakks for your response. Looking forward for the fix. I will be happy to verify the fix.
Please let me know if you need any debug info/logs from my end.
Thanks for your offering, @basaveswar-kureti! I've made PR #11312 which is now pending review. You can check out the PR branch and try building gh from source. If you did that, please let me know your thoughts/observations.
Thanks @babakks for the quick fix. I verified and it is working properly.
% /opt/homebrew/bin/gh --repo abcd/xyz run view 16266528487 --log | grep "log not found"
log not found: 45923553930
% ./gh --repo abcd/xyz run view 16266528487 --log | grep "log not found"
% ./gh version
gh version 2.75.1-3-gf67bd9a7d (2025-07-17)
https://github.com/cli/cli/releases/latest
% git status
On branch babakks/avoid-fetching-logs-for-skipped-jobs
Your branch is up to date with 'origin/babakks/avoid-fetching-logs-for-skipped-jobs'.
nothing to commit, working tree clean
Thanks for trying the changes. However, since the error message is printed on stderr the | grep wouldn't surface it. You can try 2>&1 | grep or simply |& grep.
Anyway, the PR is on our review list and should be merged before the next release, which is probably due next week. Things can always change, though, so that's just an estimation.
Activity
basaveswar-kureti commentedon Jul 14, 2025
@babakks We are on the latest version 2.75.0 where this issue is fixed, but we are still seeing this.
gh --version gh version 2.75.0 (2025-07-09) https://github.com/cli/cli/releases/tag/v2.75.0We have a job skipped due to the conditionals. Does this handles that case ?
Currently it is failing with the error:
45923553930 --> This corresponds to the skipped job id
babakks commentedon Jul 16, 2025
Thanks for reporting this, @basaveswar-kureti! 🙏
There's a new issue opened for this (#11311), so please follow up on the updates in there.
basaveswar-kureti commentedon Jul 16, 2025
Thanks @babakks for your response. Looking forward for the fix. I will be happy to verify the fix.
Please let me know if you need any debug info/logs from my end.
babakks commentedon Jul 16, 2025
Thanks for your offering, @basaveswar-kureti! I've made PR #11312 which is now pending review. You can check out the PR branch and try building
ghfrom source. If you did that, please let me know your thoughts/observations.basaveswar-kureti commentedon Jul 17, 2025
Thanks @babakks for the quick fix. I verified and it is working properly.
babakks commentedon Jul 17, 2025
Thanks for trying the changes. However, since the error message is printed on stderr the
| grepwouldn't surface it. You can try2>&1 | grepor simply|& grep.Anyway, the PR is on our review list and should be merged before the next release, which is probably due next week. Things can always change, though, so that's just an estimation.
basaveswar-kureti commentedon Jul 17, 2025
@babakks Checked with 2>&1. It is working as expected.
Thanks for the estimated release date.