ci: keep build timing report non-blocking when PR comment fails#592
Open
ainta wants to merge 1 commit into
Open
ci: keep build timing report non-blocking when PR comment fails#592ainta wants to merge 1 commit into
ainta wants to merge 1 commit into
Conversation
The "Upsert build timing PR comment" step throws on any GitHub API error, which fails the whole Build Timing Report job. In practice the comment call returns HTTP 403 "Resource not accessible by integration": this is a `workflow_run` job, so GITHUB_TOKEN is capped at the repository's default token permissions and the `issues: write` declared in the workflow cannot take effect. The rendered report is already attached to the job summary, so the comment is cosmetic, yet the failure shows up as a red X on green CI. Wrap the comment upsert in try/catch: on failure emit a core.warning (with a pointer to the Actions workflow-permission setting on 403) and let the job finish green. No behavior change when the comment posts successfully. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
🤖 PR SummaryInfrastructure / CI
Statistics
Lean Declarations
📋 **Additional Analysis**No findings. 📄 **Per-File Summaries**
Last updated: 2026-06-26 12:51 UTC. |
lalalune
pushed a commit
to lalalune/ArkLib
that referenced
this pull request
Jul 7, 2026
Collaborator
|
Thanks for diagnosing the noisy failure. I’d like to retain the PR comment, so please revise this PR to incorporate the permission correction while keeping the reporting step resilient:
I’ve closed #632 in favor of consolidating both fixes here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upsert build timing PR commentstep intry/catchso a failure to post/update the PR comment no longer fails the wholeBuild Timing Reportjob.HTTP 403, emit acore.warningthat points at the root cause (theworkflow_runtoken permission cap) instead of an unhandled error; on any other error, warn with the message.Context
The reporter added in #490 renders the timing report fine, then fails at the comment step with:
Reproduced on three recent PRs:
The workflow declares
issues: write(line 15), but because this is aworkflow_runjob,GITHUB_TOKENis capped at the repository's default token permissions, so that declaration has no effect while the repo default is read-only. The rendered report is already written to$GITHUB_STEP_SUMMARYin the previous step, so the comment is purely cosmetic — but the unhandled 403 surfaces as a red X on otherwise-green CI and sends failure notifications. (workflow_runruns aren't required checks, so this never blocked merges, e.g. #516 merged with the failure present.)This PR makes the reporting job resilient. To actually restore the PR comment, a maintainer still needs to enable write access under Settings → Actions → General → Workflow permissions (or supply a token/app granting
issues: write); the warning emitted on 403 documents this inline.Verification
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/build-timing-report.yml'))"— parses cleanly after the change.Build Timing Reportrun logs above.Posted by Claude Code (model: Opus 4.8) on behalf of the user (@ainta) with approval. Made with Claude Code.