Skip to content

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
mainfrom
fix/ci-failure-33602153733
Open

Copilot Fix(CI Failure): version-pin-drift job fails on every scheduled run (inverted event_name check)#89
github-actions[bot] wants to merge 1 commit into
mainfrom
fix/ci-failure-33602153733

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

The version-pin-drift job'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

##[warning]copilot-version default is pinned to 1.0.80 but @latest is 1.0.82
##[error]Process completed with exit code 1.

🕵️‍♂️ Diagnosis

.github/workflows/test-copilot.yml line 92 (version-pin-drift job):

test "${{ github.event_name }}" != "schedule"

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.

  • On a scheduled run: event_name == "schedule", so test "schedule" != "schedule" evaluates false → exit 1 → job fails (wrong — should succeed after warning).
  • On a manual run: 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.80 vs. registry 1.0.82).

🛠️ Proposed Fix

Flip != to =:

-          test "${{ github.event_name }}" != "schedule"
+          test "${{ github.event_name }}" = "schedule"

Verified locally with a bash simulation: event_name=schedule → exit 0; event_name=workflow_dispatch → exit 1.

⚠️ Why this PR doesn't touch the workflow file directly

This session's GitHub token does not have the workflows permission, 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 with 403 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.patch containing the exact one-line diff. A maintainer with workflows write access can apply it with:

git apply .github/ci-fixes/33602153733-version-pin-drift.patch
git rm .github/ci-fixes/33602153733-version-pin-drift.patch

or simply make the one-line edit directly in .github/workflows/test-copilot.yml and delete the patch file.

…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>
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