Copilot Fix(CI Failure): version-pin-drift job fails on every scheduled run (inverted event_name check) - #89
Open
github-actions[bot] wants to merge 1 commit into
Open
Conversation
…53733) GitHub blocks this session's token from committing directly to .github/workflows/ (no 'workflows' permission granted to the app installation), so the one-line fix is provided here as an applyable patch for a maintainer to merge with: git apply .github/ci-fixes/33602153733-version-pin-drift.patch git rm .github/ci-fixes/33602153733-version-pin-drift.patch Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
The
version-pin-driftjob's inverted event_name check makes it fail on every scheduled run, not just manual ones.Why did the CI pipeline schedule a version check and then immediately regret it? Because someone flipped a
!=and now it fails precisely when it's supposed to stay quiet. 🙃https://github.com/austenstone/copilot-cli/actions/runs/33602153733/job/56567749493#step:2:16
💥 Error Log
🕵️♂️ Diagnosis
.github/workflows/test-copilot.ymlline 92 (version-pin-driftjob):The job intends to only warn (exit 0) on drift during scheduled runs, and fail (exit 1) on manual/other triggers so a human notices. Because the step runs under
bash -e, the exit status of the last command is the step's exit status.event_name == "schedule", sotest "schedule" != "schedule"evaluates false → exit 1 → job fails (wrong — should succeed after warning).test "workflow_dispatch" != "schedule"evaluates true → exit 0 → job succeeds silently (wrong — should fail to alert).The comparison operator is inverted, causing the exact opposite of the intended behavior in both cases. This is why the job has been failing on every nightly schedule run since drift appeared (pinned
1.0.80vs. registry1.0.82).🛠️ Proposed Fix
Flip
!=to=:Verified locally with a bash simulation:
event_name=schedule→ exit 0;event_name=workflow_dispatch→ exit 1.This session's GitHub token does not have the
workflowspermission, and GitHub blocks any commit/PR content change under.github/workflows/from tokens lacking that scope (confirmed via direct push, Git Data API, and Contents API — all rejected with403 refusing to allow a GitHub App to create or update workflow ... without 'workflows' permission). That's a legitimate security control and this PR does not attempt to bypass it.Instead, this PR adds
.github/ci-fixes/33602153733-version-pin-drift.patchcontaining the exact one-line diff. A maintainer withworkflowswrite access can apply it with:or simply make the one-line edit directly in
.github/workflows/test-copilot.ymland delete the patch file.