Repository navigation
feat(ci): update remote and evals-action pins automatically #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
610a689
feat(ci): update remote and evals-action pins automatically
jongio 907759e
fix(ci): harden pin update merge gate
jongio 75a872f
chore: remove stray local test fixtures
jongio e858d73
Bind required checks to their apps and paginate branch rules
jongio 45a7edf
fix: require human approval and merge queue for pin updates
jongio 23634d9
fix: require Copilot approval for pin queue
jongio f5d671f
Request Copilot reviews for pin updates
jongio 3ee6b60
fix: guard pin updates and cancel stale comparisons
jongio 366df2d
fix: validate release tags and document human approval
jongio bd24069
Make update-remote-pins eval invoke its skill reliably
jongio d859a07
Harden pin automation GitHub reads
jongio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,161 @@ | ||
| name: Update pins | ||
| # Moves remote marketplace pins and github/evals-action pins to their newest releases in one bot PR, | ||
| # then enqueues it after required checks pass. Setup: docs/checks-and-evals.md#automatic-pin-updates. | ||
| on: | ||
| schedule: | ||
| - cron: '7,37 * * * *' | ||
| workflow_dispatch: | ||
| inputs: | ||
| dry_run: | ||
| description: Report what would change without pushing, opening, or merging a PR. | ||
| type: boolean | ||
| default: true | ||
| workflow_run: | ||
| workflows: [Validate] | ||
| types: [completed] | ||
| branches: [automation/update-pins] | ||
| permissions: | ||
| contents: read | ||
| concurrency: | ||
| group: update-pins | ||
| cancel-in-progress: false | ||
| jobs: | ||
| plan: | ||
| if: >- | ||
| github.event_name == 'workflow_dispatch' || | ||
| (github.event_name == 'schedule' && vars.PIN_AUTOMATION == 'true') || | ||
| (github.event_name == 'workflow_run' && vars.PIN_AUTOMATION == 'true' && | ||
| github.event.workflow_run.conclusion == 'success' && | ||
| github.event.workflow_run.event == 'pull_request' && | ||
| github.event.workflow_run.head_repository.full_name == github.repository) | ||
| runs-on: ubuntu-latest | ||
|
jongio marked this conversation as resolved.
Resolved
|
||
| timeout-minutes: 10 | ||
|
Copilot marked this conversation as resolved.
Resolved
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
| outputs: | ||
| changed: ${{ steps.update.outputs.changed }} | ||
| open_pr: ${{ steps.update.outputs.open_pr }} | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7 | ||
| with: | ||
| node-version: 24 | ||
| - id: update | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: node .github/scripts/update-pins.mjs update | ||
|
jongio marked this conversation as resolved.
Resolved
|
||
|
|
||
| publish: | ||
| needs: plan | ||
| if: (needs.plan.outputs.changed == 'true' || needs.plan.outputs.open_pr != '') && !(github.event_name == 'workflow_dispatch' && inputs.dry_run) | ||
| environment: pin-automation | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - id: app | ||
| uses: actions/create-github-app-token@f418cff399f7aef4c2f0ad47e25ca7a6abbdd6fc # v3.4.0 | ||
| with: | ||
| client-id: ${{ vars.PIN_APP_CLIENT_ID }} | ||
| private-key: ${{ secrets.PIN_APP_PRIVATE_KEY }} | ||
| permission-contents: write | ||
| permission-pull-requests: write | ||
| permission-workflows: write | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7 | ||
| with: | ||
| node-version: 24 | ||
| - id: update | ||
| env: | ||
| GH_TOKEN: ${{ steps.app.outputs.token }} | ||
| run: node .github/scripts/update-pins.mjs update --body-file "$RUNNER_TEMP/pin-pr.md" | ||
| - name: Check remote pins | ||
| env: | ||
| GH_TOKEN: ${{ steps.app.outputs.token }} | ||
| run: node .github/scripts/check-remote-pins.mjs | ||
| - env: | ||
| GH_TOKEN: ${{ steps.app.outputs.token }} | ||
| TITLE: ${{ steps.update.outputs.title }} | ||
| BOT: ${{ steps.app.outputs.app-slug }}[bot] | ||
| run: node .github/scripts/update-pins.mjs publish --title "$TITLE" --body-file "$RUNNER_TEMP/pin-pr.md" --bot "$BOT" | ||
|
|
||
| gate: | ||
| needs: [plan, publish] | ||
| if: >- | ||
| always() && needs.plan.result == 'success' && | ||
| !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && | ||
| (github.event_name == 'workflow_dispatch' || (vars.PIN_AUTOMATION == 'true' && | ||
| (github.event_name == 'schedule' || github.event.workflow_run.event == 'pull_request'))) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
| checks: read | ||
| statuses: read | ||
| actions: read | ||
| outputs: | ||
| decision: ${{ steps.gate.outputs.decision }} | ||
| pr_node_id: ${{ steps.gate.outputs.pr_node_id }} | ||
| head: ${{ steps.gate.outputs.head }} | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7 | ||
| with: | ||
| node-version: 24 | ||
| - id: gate | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: node .github/scripts/update-pins.mjs gate | ||
|
|
||
| enqueue: | ||
| needs: gate | ||
| if: ${{ !cancelled() && needs.gate.result == 'success' && needs.gate.outputs.decision == 'merge' && !(github.event_name == 'workflow_dispatch' && inputs.dry_run) }} | ||
| environment: pin-automation | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
| checks: read | ||
| statuses: read | ||
| actions: read | ||
| steps: | ||
| - id: app | ||
| uses: actions/create-github-app-token@f418cff399f7aef4c2f0ad47e25ca7a6abbdd6fc # v3.4.0 | ||
| with: | ||
| client-id: ${{ vars.PIN_APP_CLIENT_ID }} | ||
| private-key: ${{ secrets.PIN_APP_PRIVATE_KEY }} | ||
| permission-contents: write | ||
| permission-pull-requests: write | ||
|
jongio marked this conversation as resolved.
Resolved
jongio marked this conversation as resolved.
Resolved
jongio marked this conversation as resolved.
Resolved
|
||
| permission-workflows: write | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7 | ||
| with: | ||
| node-version: 24 | ||
| # Recheck with the run's own token (the app can't read checks), pinned to the head the gate approved. | ||
| - id: recheck | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| BOT: ${{ steps.app.outputs.app-slug }}[bot] | ||
| HEAD_SHA: ${{ needs.gate.outputs.head }} | ||
| run: node .github/scripts/update-pins.mjs gate --bot "$BOT" --expect-head "$HEAD_SHA" | ||
| - if: steps.recheck.outputs.decision == 'merge' | ||
| env: | ||
| GH_TOKEN: ${{ steps.app.outputs.token }} | ||
| PR_NODE_ID: ${{ steps.recheck.outputs.pr_node_id }} | ||
| HEAD_SHA: ${{ steps.recheck.outputs.head }} | ||
| run: | | ||
| gh api graphql \ | ||
|
jongio marked this conversation as resolved.
Resolved
|
||
| -f query='mutation($input: EnqueuePullRequestInput!) { enqueuePullRequest(input: $input) { mergeQueueEntry { state } } }' \ | ||
| -F "input[pullRequestId]=$PR_NODE_ID" \ | ||
| -F "input[expectedHeadOid]=$HEAD_SHA" \ | ||
| -F 'input[jump]=false' | ||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.