Skip to content

Commit 992ea1a

Browse files
fix(ci): resolve nightly workflow permission error (#230)
The nightly workflow was failing validation because test.yml declared `checks: write` at the workflow level. When a reusable workflow declares permissions, the caller must grant them. Scheduled runs have limited permissions and cannot grant `checks: write`, causing validation to fail before any code runs. Changes: - Remove `permissions` block from test.yml so it inherits from caller - Add `checks: write` to nightly.yml (granted for manual runs, ignored for scheduled runs which have limited permissions) - Add workflow_dispatch input to optionally enable coverage annotation - Make skip_coverage_annotation dynamic: always true for scheduled runs, configurable for manual runs --------- Co-authored-by: Claude <[email protected]>
1 parent cf85abe commit 992ea1a

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

.github/workflows/nightly.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,20 @@ on:
44
schedule:
55
# Run every Monday at 12 AM UTC
66
- cron: '0 0 * * 1'
7-
workflow_dispatch: # Allow manual trigger
7+
workflow_dispatch:
8+
inputs:
9+
skip_coverage_annotation:
10+
description: 'Skip coverage annotation'
11+
required: false
12+
default: true
13+
type: boolean
814

915
permissions:
1016
contents: read
17+
checks: write
1118

1219
jobs:
1320
test:
1421
uses: ./.github/workflows/test.yml
1522
with:
16-
skip_coverage_annotation: true
23+
skip_coverage_annotation: ${{ github.event_name == 'schedule' || inputs.skip_coverage_annotation }}

.github/workflows/test.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ on:
99
default: false
1010
type: boolean
1111

12-
permissions:
13-
contents: read
14-
checks: write
15-
1612
jobs:
1713
tests:
1814
name: Tests (PHP ${{ matrix.php }})

0 commit comments

Comments
 (0)