Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/ci-pending.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
permissions:
contents: read
issues: read
actions: write

jobs:
mark-pending:
Expand All @@ -33,8 +32,8 @@ jobs:

- name: Enable cron poller
env:
# Use GITHUB_TOKEN (with actions:write) for variable access —
# the app token may not have the actions_variables permission.
GH_TOKEN: ${{ github.token }}
# Use the app token — GITHUB_TOKEN cannot write repo variables
# (403 "Resource not accessible by integration").
GH_TOKEN: ${{ steps.token.outputs.token }}
run: |
gh variable set CI_POLLER_HAS_PENDING -R "$GITHUB_REPOSITORY" -b "true"
9 changes: 4 additions & 5 deletions .github/workflows/ci-poller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
permissions:
contents: read
issues: read
actions: write

jobs:
check-ci:
Expand Down Expand Up @@ -140,16 +139,16 @@ jobs:
fi
done

# Disable the poller if no ci-pending issues remain. Uses GITHUB_TOKEN
# (with actions:write) since the app token may lack actions_variables
# permission.
# Disable the poller if no ci-pending issues remain.
# Note: there's a small race window where ci-pending.yml could set the
# variable to "true" right before we set it to "false" here. In that case
# the new issue waits at most one cron tick (5 min) — ci-pending.yml will
# set the variable again on the next issue:opened event if needed.
- name: Disable poller if no pending issues remain
env:
GH_TOKEN: ${{ github.token }}
# Use the app token — GITHUB_TOKEN cannot write repo variables
# (403 "Resource not accessible by integration").
GH_TOKEN: ${{ steps.token.outputs.token }}
run: |
remaining=$(gh issue list -R "$GITHUB_REPOSITORY" \
--state open \
Expand Down
Loading