You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(ci): update remote and evals-action pins automatically - #28
Adds automatic release-based pin updates for remote marketplace plugins and github/evals-action, maintained through one App-authored PR from automation/update-pins.
The updater reads published releases, resolves full commit SHAs, preserves stable/prerelease channels, and edits only the allowlisted marketplace catalog, pinned action workflow, and checks documentation files.
The gate rechecks bot ownership, allowlisted files, freshly generated content, current base, completed checks, and a successful Validatelint job from the trusted workflow on the exact PR head.
Enqueue is head-pinned with expectedHeadOid; it does not directly merge or bypass review rules. GitHub must record a required approval, and Copilot must submit an explicit APPROVED review on that exact head. COMMENTED reviews do not qualify. The configured squash merge queue then runs merge_group validation.
The Marketplace Maintainer plugin guidance documents the opt-in automation policy.
Setup and outstanding blockers
Scheduled proposals require PIN_AUTOMATION=true and the documented pin-automation environment/App credentials.
The default-branch ruleset must enable strict lint and a squash merge queue with no bypass actors; Validate must include merge_group checks.
This PR changes the bundled Marketplace Maintainer plugin. Its changelog/version update is pending authoritative evidence for whether 0.2.0 is a released base; no version metadata has been changed. This remains an open review concern.
The latest Skill eval comparison failed for both candidate and baseline at 0.81 (one failed stimulus each, zero score delta). It remains a failing check; the merge gate stays fail-closed, with no exception added.
Adds an Update pins workflow that moves remote marketplace pins and
github/evals-action pins to their newest releases in one bot PR, then
squash-merges it pinned to the checked head after every check passes.
Manual dispatch defaults to a dry run; unattended runs need PIN_AUTOMATION.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Merge only when the PR head matches a fresh update and every commit is
authored and committed by the bot; wait for every required status check.
- Read all release pages and surface non-404 lookup failures.
- Stage only allowlisted files that exist; let the plan job read PRs.
- Pin github/evals-action to a commit on its main branch.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Re: Copilot review 5981677270 (concern:1906b9777fa8657f, merge gate trusts attribution and can merge before required checks) Fixed in 907759e: - The gate waits unless the PR head's allowlisted files equal a fresh update output, so attribution alone no longer authorizes a merge. - It waits for every ruleset or branch-protection required check (check run or status) plus lint. 75a872f removes stray local test fixtures. Re: Copilot review 5982525509 - concern:aab293079641ef79 (headline), concern:85f4a514d6bf32eb and concern:ec8bfb60638dda0e (rules pagination, App identity): fixed in e858d73. - concern:fd22de5e9b2b89b2 (docs conflict with manual review): fixed in e858d73. - concern:27a9b1db3611570f (merge job always()): fixed in e858d73; it now uses !cancelled(). - concern:0c85452a130e2d6f (canonical-format guard): declined. A non-canonical marketplace.json makes the run fail closed with a clear error, and no PR is opened. Requiring the format in Validate would change the template contract for every user.
Findings from f5d671f (Wbreza 5985148798, Copilot 5985190475)
Privileged workflow_run path, merge-queue mutation input/permissions, already-queued PRs, docs and changelog: fixed in 3ee6b60.
Evaluation gate: fixed in bd24069; hosted run passes at 1.0 with the threshold unchanged.
Copilot review 5996180518 ("Needs a closer look", head d859a07)
Declined: Copilot approvals or stale human approvals satisfying the gate.
Setup step 3 (docs/checks-and-evals.md) requires a human approval that Copilot approvals don't count toward.
Approval freshness (dismissing stale approvals, requiring approval of the last push) is ruleset policy, which reviewDecision reflects.
The gate independently requires head files equal to a fresh update from main, plus an exact-head Copilot APPROVED review.
The guide already states that enabling automation means trusting upstream releases.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The merge gate can allow merges before required checks report because it reads only the first page of branch rules and drops configured GitHub App identities.
Validate canonical catalog formatting before merge
.github/scripts/update-pins.mjs:71
A catalog with valid but noncanonical JSON, such as a missing final newline, passes the current catalog validator but fails this guard. After that edit merges, every scheduled plan and merge recheck fails, stopping pin updates. Enforce the same format in Validate, or document the exact formatting requirement in the automation setup.
Respect workflow cancellation in the merge job
.github/workflows/update-pins.yml:110
always() lets this merge job run even when a maintainer cancels the workflow after the gate succeeds, so cancellation may not stop the squash merge. Use !cancelled() instead: it still permits the skipped upstream jobs on workflow_run events while respecting cancellation. Wrap the expression in ${{ }} because it starts with !.
Read every branch-rules page, keep each required check's app binding, skip
the merge job when cancelled, and document that opt-in pin automation trusts
published releases instead of reviewing upstream changes.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The automation can accept a successful lint result from an unrelated integration and merge against a changed, unvalidated base, leaving critical validation safeguards unresolved.
Verify lint came from the trusted Validate workflow
.github/scripts/update-pins.mjs:153
The mandatory lint requirement accepts a successful commit status or check run based only on its name. Without a separate source-bound branch rule, an unrelated integration can satisfy it before Validate runs, and the bypass App can then merge without genuine validation. Verify a successful lint job from the trusted Validate workflow on this head independently of generic required-context matching, and cover the status-only case.
Enforce base freshness at merge time
.github/workflows/update-pins.yml:146
The merge request pins only the PR head, so a default-branch update between the recheck and merge invalidates the up-to-date decision without changing that head. If the App bypasses the status-check rules, GitHub can still merge against this untested base. Keep strict up-to-date checks outside the App's review bypass, or use an enforced merge queue so GitHub checks the base at merge time.
The reason will be displayed to describe this comment to others. Learn more.
Summary
Well-structured automation overall: separating read-only plan/gate jobs from pin-automation environment jobs, requiring staleFiles to match a fresh default-branch planUpdate, and preserving GitHub App bindings on required check runs provide strong defense-in-depth.
Publishing as Comment (per autopilot review policy) for three Medium items and two Low edge cases:
Medium
.github/scripts/update-pins.mjs (listReleases / githubApi):githubApi inherits Node's 1 MiB spawnSyncmaxBuffer, throwing ENOBUFS on large 100-item /releases pages or /compare payloads with bundled dist/ diffs.
.github/scripts/update-pins.mjs (requiredChecks):GET /repos/{owner}/{repo}/rules/branches/{branch} returns HTTP 403 (Upgrade to GitHub Pro or make this repository public...) on Free-plan private copies of this starter template, causing gate and recheck to fail unconditionally instead of treating rulesets as empty.
plugins/marketplace-maintainer/.../remote-pins.md: Modifies plugins/marketplace-maintainer/ without a corresponding plugins/marketplace-maintainer/CHANGELOG.md entry (and plugin.json/marketplace.json version bump if 0.2.0 has already been released, per AGENTS.md).
Low
.github/scripts/update-pins.mjs (evaluateMergeGate): Does not return "wait" while GitHub is asynchronously computing mergeability (mergeable: null / mergeable_state: "unknown"), risking HTTP 405 on squash merge.
.github/scripts/update-pins.mjs (publish): Closes or edits an open PR on automation/update-pins without checking pr.user matches bot when compare.commits is empty (aheadBy === 0) or contains cherry-picked bot commits.
The reason will be displayed to describe this comment to others. Learn more.
Re-review Summary (45a7edf)
Thanks for addressing the githubApimaxBuffer limit, GitHub Free ruleset 403 handling, mergeable_state === "unknown" wait, assertBotPr guard, and trustedValidateLint check!
Moving from direct squash-merge + review-bypass to required human approval + merge-queue enqueue (enqueuePullRequest) is a great security improvement, though 45a7edf introduces two High blockers in the new enqueue job plus two Medium and two Low follow-ups. Publishing as Comment per autopilot review policy:
High
.github/workflows/update-pins.yml (enqueue GraphQL syntax):gh api graphql only nests variables with bracket notation (input[pullRequestId]=...), not dot notation (-F input.pullRequestId=...), leaving $input unset (null) and failing every enqueuePullRequest call with Variable $input of type EnqueuePullRequestInput! was provided invalid value.
.github/workflows/update-pins.yml (enqueue App token permissions):enqueue narrowed actions/create-github-app-token to permission-pull-requests: write only, omitting permission-contents: write (required by enqueuePullRequest) and permission-workflows: write (required whenever a pin PR updates .github/workflows/skill-eval-comparison.yml).
Medium
.github/scripts/update-pins.mjs (getReviewDecision / evaluateMergeGate): Does not check isInMergeQueue, so scheduled/manual runs while an approved PR is waiting in the merge queue attempt a duplicate enqueuePullRequest and fail enqueue.
plugins/marketplace-maintainer/.../remote-pins.md: Still pending authoritative confirmation of whether 0.2.0 is a released base (conservative default: do not guess release history without evidence) plus the matching CHANGELOG.md entry (and 0.2.1 version bump if 0.2.0 is released); also still describes unattended merge without human approval.
Low
.github/scripts/update-pins.mjs (planUpdate PR body): Generated PR description still tells maintainers "It merges this PR after every check passes" instead of noting that human approval is required before merge-queue enqueue.
docs/checks-and-evals.md (merge queue prerequisite): Worth noting that GitHub Merge Queues require a public organization repository or GitHub Enterprise Cloud organization repository, so adopters on personal or non-GHEC private repos know enqueuePullRequest requires merge-queue support.
The reason will be displayed to describe this comment to others. Learn more.
Re-review Summary (23634d9)
23634d9 landed while my 45a7edf review was being posted—updating the review for the new head (23634d9):
Carry-over High blockers in .github/workflows/update-pins.yml (enqueue GraphQL -F input.* dot-syntax bug and missing permission-contents: write / permission-workflows: write on the enqueue App token) and carry-over Medium items (isInMergeQueue idempotency and marketplace-maintainer changelog/version status) still apply on 23634d9.
The new approvedCopilotReview() gate in 23634d9 adds a Medium configuration/agency issue: by default Copilot code review only posts COMMENTED reviews and this repo's org ruleset currently has review_on_push: false (while docs/checks-and-evals.md doesn't document enabling Copilot approvals or Review new pushes), which will deadlock even human-approved PRs; conversely, on repos without require_code_owner_review where Copilot approvals are enabled, Copilot alone can satisfy both reviewDecision === "APPROVED" and automatedReviewApproved with no human approver.
Publishing as Comment per autopilot review policy.
The reason will be displayed to describe this comment to others. Learn more.
Re-review Summary (f5d671f)
Adding requestCopilotReview (POST /repos/{owner}/{repo}/pulls/{pull_number}/copilot-code-review with 409 pending handling) and documenting the org/enterprise Copilot PR-approval requirement in docs/checks-and-evals.md cleanly resolves the Copilot re-review-on-push and setup-documentation gaps from 23634d9.
Publishing as Comment per autopilot review policy for one new High workflow-trigger vulnerability introduced in f5d671f, plus the carry-over High/enqueue and Medium items that crossed in flight with f5d671f:
High
.github/workflows/update-pins.yml (plan.if on workflow_run — new in f5d671f): Adding workflow_run to plan.if without vars.PIN_AUTOMATION == 'true', github.event.workflow_run.event == 'pull_request', and github.event.workflow_run.head_repository.full_name == github.repository allows any Validate run on a branch named automation/update-pins—including external fork PRs and paused (PIN_AUTOMATION != 'true') repositories—to trigger plan and publish in the privileged pin-automation environment (minting the App token, pushing commits, opening PRs, and requesting paid Copilot reviews).
.github/workflows/update-pins.yml (enqueue GraphQL -F input.* dot syntax — carry-over): Sends literal "input.pullRequestId" variable names instead of a nested $input object, failing every enqueuePullRequest call.
.github/workflows/update-pins.yml (enqueue App token permissions — carry-over): Omits permission-contents: write and permission-workflows: write needed by enqueuePullRequest.
Medium
.github/scripts/update-pins.mjs (getReviewDecision / evaluateMergeGate — carry-over): Check isInMergeQueue before returning "merge" so scheduled/manual runs don't fail re-enqueuing an already-queued PR.
plugins/marketplace-maintainer/.../remote-pins.md (carry-over): Pending maintainer confirmation of 0.2.0 release-base status + CHANGELOG.md entry (AGENTS.md), and updating lines 82–83 to mention required approvals + merge queue.
Low
.github/scripts/update-pins.mjs (requestCopilotReview — new in f5d671f): Reading pr.head.sha from openPr() immediately after force-pushing can observe the previous SHA before GitHub synchronizes the PR and skip requesting review until the next 30-minute run.
docs/checks-and-evals.md (carry-over): Note org/GHEC availability requirement for GitHub Merge Queues.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The merge-queue GraphQL call uses literal dotted keys instead of a nested input object, leaving the required variable missing and blocking every otherwise-approved update.
The reason will be displayed to describe this comment to others. Learn more.
Re-review Summary (3ee6b60) — Approved
All previous High, Medium, and Low findings are cleanly resolved in 3ee6b60, with comprehensive regression tests and passing Validate (lint) checks:
Workflow & privilege boundaries (.github/workflows/update-pins.yml):plan.if and gate.if now require PIN_AUTOMATION == 'true' plus a successful same-repository pull_requestValidate run on workflow_run, enqueue uses bracket-nested GraphQL variables (input[...]), and the enqueue App token grants the required contents, pull-requests, and workflows write scopes.
Queue & review safety (.github/scripts/update-pins.mjs, docs/checks-and-evals.md, remote-pins.md): Both publish() and evaluateMergeGate() leave already-queued PRs untouched (isInMergeQueue), requestCopilotReview() avoids duplicate requests, and documentation clearly covers Copilot approval policy and org/GHEC merge-queue requirements.
Stale PR eval cancellation (.github/workflows/skill-eval-comparison.yml): Per-job PR concurrency cancels superseded select/run-baseline/run jobs while keeping workflow_dispatch runs and the serialized report job intact.
Notes / assumptions:
Plugin version status (plugins/marketplace-maintainer/): With no GitHub tags or releases published in this repository, assuming 0.2.0 is still unreleased (treating unknown external release status as a coverage limit per plugin-reviewer.agent.md)—CHANGELOG.md now records the change under ## 0.2.0 (if 0.2.0 was already released externally, bump plugin.json, marketplace.json, and CHANGELOG.md to 0.2.1; the PR description's blocker note about the changelog can also be trimmed).
Eval comparison check: Both baseline and candidate fail update-remote-pins under single-trial claude-haiku-5.5 (0.92/0.81 baseline vs 0.81 candidate across runs), reflecting pre-existing model variance on main rather than a defect in remote-pins.md.
The reason will be displayed to describe this comment to others. Learn more.
Re-review Summary (366df2d) — Approved
Verified 366df2d on top of 3ee6b60 — zero findings remain:
Release-tag hardening (.github/scripts/update-pins.mjs, .github/scripts/update-pins.test.mjs):safeReleaseTag() restricts source.ref and release.tag_name to /^[A-Za-z0-9._-]+$/ before API lookups or PR text rendering, with regression coverage rejecting markdown/URL injection strings.
Human + Copilot approval separation (docs/checks-and-evals.md): Explicitly documents keeping Copilot approvals excluded from required human approvals while enabling Copilot approving reviews, matching GitHub's repository Copilot auto-approval settings.
Plugin version & changelog (plugins/marketplace-maintainer/CHANGELOG.md): Maintainer confirmed 0.2.0 is unreleased, so recording the update under ## 0.2.0 without a version bump satisfies AGENTS.md.
Name the skill in the two skill-required stimuli, matching the
pr-description eval pattern. claude-haiku-5.5 otherwise answered by
reading files directly, failing skill-invocation (0/3 locally). Graders,
threshold, and the negative control are unchanged; 9/9 local trials pass.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
Re-review Summary (bd24069) — Approved
Verified bd24069 — all CI checks (lint, Skill eval comparison, CodeQL, and github-advanced-security) pass with zero Critical, High, or Medium findings:
evals/marketplace-maintainer/skills/update-remote-pins/eval.yaml: Explicitly naming update-remote-pins in the two type: capability positive/boundary stimuli matches the established pr-description eval pattern under claude-haiku-5.5 while keeping scoring.threshold: 1, grader.mjs outcome checks, and the disallowed negative control unchanged. (Low note: naming the skill trades implicit trigger-discovery coverage for deterministic claude-haiku-5.5 activation; also the PR body's "Setup and outstanding blockers" notes on the 0.2.0 changelog and failing eval comparison can optionally be updated before squash-merge since both are now resolved.)
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Incomplete history checks can allow force-pushing or deleting branches containing human-authored commits, while the gate can enqueue releases without fresh human approval of the current head.
The reason will be displayed to describe this comment to others. Learn more.
Re-review Summary (d859a07) — Approved
Verified d859a07 — all CI checks (lint, Skill eval comparison, CodeQL, and github-advanced-security) pass with zero Critical, High, or Medium findings:
getMergeState() (.github/scripts/update-pins.mjs, .github/scripts/update-pins.test.mjs): Uses -f for owner and name (String!) and -F for number (Int!), preventing gh api type coercion on numeric/boolean-looking repo or owner names.
remoteBranch() (.github/scripts/update-pins.mjs, .github/scripts/update-pins.test.mjs): Fails closed when compare.commits.length !== compare.ahead_by (truncated compare history >250 commits), with unit test coverage.
readGate() (.github/scripts/update-pins.mjs): Fetches commit statuses with per_page=100 alongside check-runs?per_page=100.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The merge gate can enqueue updates without fresh human approval of the current head, because Copilot approvals or stale human reviews can satisfy its approval checks.
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
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
Adds automatic release-based pin updates for remote marketplace plugins and
github/evals-action, maintained through one App-authored PR fromautomation/update-pins.Validatelintjob from the trusted workflow on the exact PR head.expectedHeadOid; it does not directly merge or bypass review rules. GitHub must record a required approval, and Copilot must submit an explicitAPPROVEDreview on that exact head.COMMENTEDreviews do not qualify. The configured squash merge queue then runsmerge_groupvalidation.Setup and outstanding blockers
PIN_AUTOMATION=trueand the documentedpin-automationenvironment/App credentials.lintand a squash merge queue with no bypass actors;Validatemust includemerge_groupchecks.0.2.0is a released base; no version metadata has been changed. This remains an open review concern.Validation
node --test .github/scripts/update-pins.test.mjs .github/scripts/validation.test.mjs— 39 passed, 0 failed.npm run lint— passed (six skill lints and eval YAML checks).git diff --check— passed.