Repository navigation
ci: open the competitor and adoption review PRs with the App token - #586
Merged
Merged
Conversation
A PR opened or a branch pushed with GITHUB_TOKEN triggers no workflow, so CI never ran on the human review PRs from update-competitive-matrix.yml and update-adoption-wall.yml. Both review paths now push and open their PR with the copilotkit-bot App token that the auto-land path already mints. The review PR is still never merged by the workflow. The mint step's condition is now the union of the two steps it serves. The workflow token loses the scopes it no longer uses: pull-requests write on both jobs, and contents write on the competitive-matrix job.
commit: |
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.
What
Follow-up to #583 (and the same bug #581 had). When a refresh needs a human, the review PR was still pushed and opened with
GITHUB_TOKEN. GitHub does not start workflows fromGITHUB_TOKENevents, so CI never ran on that PR.Before, in
update-competitive-matrix.yml:update-adoption-wall.ymlhad the same gap:Change
contents/pull-requestswrite scopes). No new secret.changed == 'true'exists && changed && (status == 'safe' || status == 'needs-review')pull-requests: writeis gone from both jobs. The competitive-matrix job is nowcontents: read, because its workflow token only reads the API now.GITHUB_TOKENinto.git/config. The review step now passes the App token through git's environment config, like the auto-land step.if:traceCompetitive matrix:
docs_changed)confined != 'true')Adoption wall: auto-land (
exists && safe && changed && confined) and review (exists && changed && (needs-review || (safe && !confined))) are both subsets of the mint condition. A clean run, a run with no change, or a run with no state branch mints nothing.Red-green proof
Contract test added to
src/__tests__/competitive-matrix-slack.test.ts(review PRs are opened with the App token), for both workflows. It checks that the review step usessteps.app-token.outputs.tokenfor push and PR, that no workflow-token git credential remains, that the review step never merges, and that the mint condition covers the review path.RED (new test against the
origin/mainworkflows):GREEN (same test against this branch):
Full suite: 483 files, 19670 tests passed.
actionlintexit 0.zizmor --offlineexit 0 (no findings). typecheck, eslint and prettier clean.End-to-end proof
Not triggered by hand: mock-server.com currently returns 403, so a run would fail before these steps. The end-to-end proof is the next scheduled Monday run.