From b33d105e8775ff6d780c9c01672edf700e14b56e Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 4 Jun 2026 12:22:15 -0700 Subject: [PATCH] Fix repo health GitHub CLI auth --- .github/workflows/repo-health.yml | 3 +++ tests/test_repo_health_workflow.py | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 tests/test_repo_health_workflow.py diff --git a/.github/workflows/repo-health.yml b/.github/workflows/repo-health.yml index 254a50d..4a2eb55 100644 --- a/.github/workflows/repo-health.yml +++ b/.github/workflows/repo-health.yml @@ -6,6 +6,7 @@ on: workflow_dispatch: permissions: + actions: read contents: read issues: write pull-requests: read @@ -14,6 +15,8 @@ jobs: health-check: runs-on: ubuntu-latest timeout-minutes: 10 + env: + GH_TOKEN: ${{ github.token }} steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 diff --git a/tests/test_repo_health_workflow.py b/tests/test_repo_health_workflow.py new file mode 100644 index 0000000..858426d --- /dev/null +++ b/tests/test_repo_health_workflow.py @@ -0,0 +1,11 @@ +from pathlib import Path + + +WORKFLOW = Path(".github/workflows/repo-health.yml") + + +def test_repo_health_workflow_authenticates_github_cli() -> None: + workflow = WORKFLOW.read_text(encoding="utf-8") + + assert "actions: read" in workflow + assert "GH_TOKEN: ${{ github.token }}" in workflow