Skip to content

Commit 99f6eca

Browse files
authored
Add and isolate content:write permission for pre-commit updates
This workflow has been failing because of the permissions revocation in a previous commit. This commit restores that permission set at a job-granular level.
1 parent 71c6363 commit 99f6eca

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/pre-commit-updates.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,28 @@ jobs:
2323
env:
2424
SKIP: "poetry-version-resetter"
2525

26+
- name: Upload changed .pre-commit-config.yaml
27+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
28+
with:
29+
name: ".pre-commit-config.yaml"
30+
path: ".pre-commit-config.yaml"
31+
32+
# This second, dependent job is necessary to isolate the content:write permissions that the auto-update job doesn't need.
33+
pr:
34+
needs: auto-update
35+
permissions:
36+
contents: write
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
40+
with:
41+
persist-credentials: false
42+
43+
- name: Download changed .pre-commit-config.yaml
44+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
45+
with:
46+
name: ".pre-commit-config.yaml"
47+
2648
- uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7
2749
if: always()
2850
with:

0 commit comments

Comments
 (0)