Skip to content

Commit 2febc00

Browse files
widgetiiJohnclaude
authored
cleanup: grant actions:write and skip manifest refresh on no-op (#100)
Mirrors OpenIPC/firmware#2133. Today's scheduled cleanup run failed with HTTP 403: Resource not accessible by integration when dispatching manifest.yml — the prune job only declared contents:write. The refresh step also fires on the empty-prune path (exit 0 only exits the step, not the job), which is wasted work since manifest.yml is already kept fresh by master.yml's workflow_run. Add actions:write to the permissions block, and gate the refresh on a step output so it runs only after an actual deletion. Co-authored-by: John <zekccsripfwrocp-15689@yn.furvionx.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9d8d5a3 commit 2febc00

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

.github/workflows/cleanup.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
permissions:
88
contents: write
9+
actions: write
910

1011
concurrency:
1112
group: gh-pages-manifest
@@ -19,6 +20,7 @@ jobs:
1920
- uses: actions/checkout@v4
2021

2122
- name: Delete releases beyond the 90 newest
23+
id: prune
2224
env:
2325
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2426
run: |
@@ -29,6 +31,7 @@ jobs:
2931
3032
if [ -z "$to_delete" ]; then
3133
echo "Nothing to delete; <=90 dated nightlies present."
34+
echo "pruned=false" >> "$GITHUB_OUTPUT"
3235
exit 0
3336
fi
3437
@@ -37,8 +40,10 @@ jobs:
3740
echo "Deleting $tag"
3841
gh release delete "$tag" --cleanup-tag --yes
3942
done
43+
echo "pruned=true" >> "$GITHUB_OUTPUT"
4044
4145
- name: Refresh manifest
46+
if: steps.prune.outputs.pruned == 'true'
4247
env:
4348
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4449
run: gh workflow run manifest.yml

0 commit comments

Comments
 (0)