fix(ci): persist Hacktoberfest tracker via a PR (protected-branch push was silently failing) - #15231
Conversation
…g to protected master
Closing this pull request as invalid@priya-sundaram-dev, this pull request is being closed as none of the checkboxes have been marked. It is important that you go through the checklist and mark the ones relevant to this pull request. Please read the Contributing guidelines. If you're facing any problem on how to mark a checkbox, please read the following instructions:
NOTE: Only |
|
https://docs.zizmor.sh/audits/#superfluous-actions Recommends using |
Per @cclauss / zizmor 'superfluous actions' audit, persist the rolling tracker PR with the gh CLI rather than a third-party action.
|
Good call — switched the persist step over to the bundled |
|
Dry run is failing. Should I wait for that to be fixed or should I review and merge? |
The dry run was failing because a run can exhaust the GITHUB_TOKEN's 1000/hour-per-repo budget (shared across concurrent runs) — chiefly the awaiting-reviews directory scan. A single exhausted request then raised and killed the whole job. - _request now honours Retry-After (secondary limits) and, once retries are exhausted, raises BestEffortError instead of a bare RuntimeError. - Row resolution, the directory scan, and the search counts catch BestEffortError and degrade (keep the row / mark the stat unavailable) instead of failing. Only the post-Oct-1 retirement exits non-zero. - Trim the directory scan to 120 PRs and CONCURRENCY to 5 to stay well under the shared budget in the first place.
|
Please give it one more push-CI cycle — I just fixed the dry-run failure (049c7df → new commit). Root cause wasn't the persist logic you're reviewing: the The refresh is best-effort, so it shouldn't ever fail CI on a transient rate limit. This commit:
Net: the only non-zero exit is still the intentional post-Oct-1 retirement. Once the new dry run is green, it's good to review and merge. 🙏 |
|
Green now ✅ — the scheduled |
What & why
The daily
hacktoberfest_prepjob has been reporting success while silently doing nothing. @cclauss flagged that the last scheduled run "made numerous changes but failed on git commit" (run 34223130868).Root cause, from that run's log:
masteris protected, so the defaultGITHUB_TOKENcan't push to it directly. My originalgit push || echo "Nothing to push"swallowed the rejection, so the step went green and the refreshed tracker was thrown away.Fix
Persist the refreshed
docs/hacktober_2026_prep.mdby opening — or updating in place — a single rolling PR (peter-evans/create-pull-request@v7) instead of pushing to master. Re-runs reuse the same branch, so there's never more than one open tracker PR, and a maintainer merges it whenever they want to capture a snapshot. The dry-run behaviour onpush/pull_requestand the intentional post-Oct-1 retirement failure are unchanged.Adds
pull-requests: writeto the workflow permissions.Heads-up:
directory_writer.ymlhas the same latent bugWhile tracing this I checked
directory_writer.yml, which also pushes to master (git push --force ... || true). Its recent runs are also hittingGH006and being masked by|| true— e.g. run 34269173911 shows! [remote rejected] HEAD -> master (protected branch hook declined). SoDIRECTORY.mdisn't actually being auto-updated anymore. Happy to send a follow-up PR converting that one the same way (or however you prefer) if useful.One dependency to confirm
This relies on the org setting Settings → Actions → General → "Allow GitHub Actions to create and approve pull requests" being enabled. If it's off,
create-pull-requestwill fail with a clear permissions error and we can either enable it or switch to a scoped app/PAT token — your call on which fits the repo's security posture. I only have public read access, so I couldn't verify the toggle myself.Refs #15081, #15225
Checklist