Skip to content

Fix pre_activation GH CLI auth in efficiency improver workflow#443

Open
Copilot wants to merge 2 commits into
support/3.xfrom
copilot/fix-pre-activation-job
Open

Fix pre_activation GH CLI auth in efficiency improver workflow#443
Copilot wants to merge 2 commits into
support/3.xfrom
copilot/fix-pre-activation-job

Conversation

Copilot AI commented May 26, 2026

Copy link
Copy Markdown
Contributor

The pre_activation job in the Efficiency Improver workflow fails before activation because a scheduled guard step runs gh pr list without GH CLI auth context. This PR fixes that auth gap so the pre-activation gate can execute as intended.

  • Root cause (workflow guard step)

    • In .github/workflows/efficiency-improver.lock.yml, pre_activation step id: check calls:
      • gh pr list --repo "$GITHUB_REPOSITORY" ...
    • That step had no GH_TOKEN env, causing gh to exit with auth error.
  • Change made

    • Added step-local token wiring for GH CLI in pre_activation:
      - id: check
        run: |
          MAX_OPEN_PRS=8
          if [[ "$GITHUB_EVENT_NAME" != "schedule" ]]; then exit 0; fi
          COUNT=$(gh pr list --repo "$GITHUB_REPOSITORY" --state open --search 'in:title "[efficiency-improver]"' --json number --jq 'length')
          [[ "$COUNT" -lt "$MAX_OPEN_PRS" ]]
        env:
          GH_TOKEN: ${{ github.token }}
  • Scope

    • Single-file, surgical workflow fix.
    • No behavior changes outside the pre_activation auth context.

Copilot AI changed the title [WIP] Fix failing GitHub Actions job pre_activation Fix pre_activation GH CLI auth in efficiency improver workflow May 26, 2026
Copilot AI requested a review from Shazwazza May 26, 2026 21:08
@Shazwazza Shazwazza marked this pull request as ready for review May 27, 2026 16:18
@greptile-apps

greptile-apps Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a missing authentication context in the pre_activation job of the Efficiency Improver workflow, where gh pr list was called without a GH_TOKEN env variable, causing the CLI to exit with an auth error on scheduled runs.

  • The check step in pre_activation now has env: GH_TOKEN: ${{ github.token }}, which is sufficient given the job's existing pull-requests: read permission scope.
  • A trailing newline at the end of the file is also removed as part of the edit.

Confidence Score: 5/5

Safe to merge — the change is a two-line, targeted addition of a well-scoped token to an already-permissioned job step.

The pre_activation job already declares permissions: pull-requests: read, so github.token carries exactly the right scope for gh pr list. The fix is isolated to a single step that previously could not authenticate on schedule events, and no other behavior is changed.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/efficiency-improver.lock.yml Adds GH_TOKEN env to the check step in pre_activation so gh pr list can authenticate; also removes a trailing newline at EOF.

Reviews (1): Last reviewed commit: "Fix GH CLI auth in pre_activation check ..." | Re-trigger Greptile

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.

2 participants