Skip to content

ci(benchmarks): open a PR with the refreshed README instead of pushing to main - #344

Merged
naorpeled merged 1 commit into
jeremydaly:mainfrom
naorpeled:ci/benchmarks-open-pr
Aug 8, 2026
Merged

ci(benchmarks): open a PR with the refreshed README instead of pushing to main#344
naorpeled merged 1 commit into
jeremydaly:mainfrom
naorpeled:ci/benchmarks-open-pr

Conversation

@naorpeled

Copy link
Copy Markdown
Collaborator

The Benchmarks workflow's final step pushes the refreshed README straight to the default branch, which doesn't accept direct pushes. This replaces that with a PR.

Split out of #343 so the crash fix and this workflow change can be reviewed and merged independently — they touch non-overlapping parts of benchmark.yml and don't conflict in either merge order.

Change

  • Commits the refreshed README to a per-run branch, benchmarks/refresh-<version>-<run_id>, then opens a PR against the default branch. Including the run ID means concurrent or repeated runs never clobber one another.
  • PR body links back to the generating run and embeds the full results table in a <details> block, with a note that shared-runner numbers are noisy so small movements aren't regressions.
  • Renames the workflow_dispatch input commitopen_pr, since the semantics changed.
  • Adds pull-requests: write to the job permissions.
  • Drops [skip ci] from the commit message — it existed to avoid re-triggering CI on a direct push to the default branch, which no longer applies.

⚠️ Before merging: the PR will have no status checks

PRs opened with the default GITHUB_TOKEN do not trigger pull_request workflows. This is a deliberate GitHub restriction to prevent recursive workflow runs, not something the workflow can opt out of.

So the benchmark PR will show no checks at all. If the default branch has required status checks, it won't be mergeable without an admin override — which would trade one blocked automation for another.

If that's the case, the fix is to create the PR with a PAT or GitHub App token instead of github.token. I left it on GITHUB_TOKEN here because it needs no new secret and the change is README-only, but say the word and I'll switch it.

Verification

The workflow can't be fully exercised until it's on the default branch, so verification was done in pieces:

  • YAML parses; permissions and the renamed input resolve as intended, and no stale inputs.commit references remain.
  • Ran the PR-body shell block locally under the real environment variables (GITHUB_SERVER_URL, GITHUB_REPOSITORY, GITHUB_RUN_ID, GITHUB_EVENT_NAME) and confirmed the branch name and rendered Markdown are correct.
  • RESULTS.md is ~2.9KB, well within GitHub's 65536-character PR body limit.
  • Prettier-clean.

Note that the "no changes" early-exit is preserved: if the benchmarks produce an identical README, the step logs and exits without opening an empty PR.

…g to main

The default branch doesn't accept direct pushes, so the final step now
commits to a per-run branch and opens a PR. Renames the workflow_dispatch
'commit' input to 'open_pr' to match, and adds pull-requests: write.
@naorpeled
naorpeled force-pushed the ci/benchmarks-open-pr branch from 6d3f573 to 10da24c Compare August 8, 2026 17:00
@naorpeled
naorpeled merged commit d9fc027 into jeremydaly:main Aug 8, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant