Add explicit workflow permissions
| @@ -7,6 +7,10 @@ on: | |||
| 7 | issue_comment: | 7 | issue_comment: |
| 8 | types: [created] | 8 | types: [created] |
| 9 | 9 | ||
| 10 | permissions: | ||
| 11 | contents: read | ||
| 12 | issues: write | ||
| 13 | |||
| 10 | jobs: | 14 | jobs: |
| 11 | label-on-content: | 15 | label-on-content: |
| 12 | name: 🏷️ Label Issues by Content | 16 | name: 🏷️ Label Issues by Content |
| @@ -6,6 +6,10 @@ on: | |||
| 6 | - staging | 6 | - staging |
| 7 | - release | 7 | - release |
| 8 | 8 | ||
| 9 | permissions: | ||
| 10 | contents: read | ||
| 11 | issues: write | ||
| 12 | |||
| 9 | jobs: | 13 | jobs: |
| 10 | # This runs commits to staging/release, reading the commit messages. Check `pr-auto-manager.yml`:`update-linked-issues` for PR-linked updates. | 14 | # This runs commits to staging/release, reading the commit messages. Check `pr-auto-manager.yml`:`update-linked-issues` for PR-linked updates. |
| 11 | update-linked-issues: | 15 | update-linked-issues: |
| @@ -6,6 +6,11 @@ on: | |||
| 6 | schedule: | 6 | schedule: |
| 7 | - cron: '0 0 * * *' # Runs every day at midnight UTC | 7 | - cron: '0 0 * * *' # Runs every day at midnight UTC |
| 8 | 8 | ||
| 9 | permissions: | ||
| 10 | contents: read | ||
| 11 | issues: write | ||
| 12 | pull-requests: write | ||
| 13 | |||
| 9 | jobs: | 14 | jobs: |
| 10 | mark-inactivity: | 15 | mark-inactivity: |
| 11 | name: ⏳ Mark Issues/PRs without Activity | 16 | name: ⏳ Mark Issues/PRs without Activity |
| @@ -6,6 +6,11 @@ on: | |||
| 6 | pull_request_target: | 6 | pull_request_target: |
| 7 | types: [closed] | 7 | types: [closed] |
| 8 | 8 | ||
| 9 | permissions: | ||
| 10 | contents: read | ||
| 11 | issues: write | ||
| 12 | pull-requests: write | ||
| 13 | |||
| 9 | jobs: | 14 | jobs: |
| 10 | remove-labels: | 15 | remove-labels: |
| 11 | name: 🗑️ Remove Pending Labels on Close | 16 | name: 🗑️ Remove Pending Labels on Close |
| @@ -6,6 +6,11 @@ on: | |||
| 6 | pull_request_target: | 6 | pull_request_target: |
| 7 | types: [opened] | 7 | types: [opened] |
| 8 | 8 | ||
| 9 | permissions: | ||
| 10 | contents: read | ||
| 11 | issues: write | ||
| 12 | pull-requests: write | ||
| 13 | |||
| 9 | jobs: | 14 | jobs: |
| 10 | label-maintainer: | 15 | label-maintainer: |
| 11 | name: 🏷️ Label if Author is a Repo Maintainer | 16 | name: 🏷️ Label if Author is a Repo Maintainer |
| @@ -6,6 +6,10 @@ on: | |||
| 6 | pull_request_review_comment: | 6 | pull_request_review_comment: |
| 7 | types: [created] | 7 | types: [created] |
| 8 | 8 | ||
| 9 | permissions: | ||
| 10 | contents: read | ||
| 11 | pull-requests: write | ||
| 12 | |||
| 9 | jobs: | 13 | jobs: |
| 10 | label-by-size: | 14 | label-by-size: |
| 11 | name: 🏷️ Label PR by Size | 15 | name: 🏷️ Label PR by Size |
| @@ -75,7 +79,7 @@ jobs: | |||
| 75 | name: 🗑️ Remove Stale Label on Comment | 79 | name: 🗑️ Remove Stale Label on Comment |
| 76 | runs-on: ubuntu-latest | 80 | runs-on: ubuntu-latest |
| 77 | # Only runs when this is not done by the github actions bot | 81 | # Only runs when this is not done by the github actions bot |
| 78 | if: github.actor != 'github-actions[bot]' | 82 | if: github.event_name == 'pull_request_review_comment' && github.actor != 'github-actions[bot]' |
| 79 | 83 | ||
| 80 | steps: | 84 | steps: |
| 81 | - name: Remove Stale Label | 85 | - name: Remove Stale Label |
| @@ -95,6 +99,12 @@ jobs: | |||
| 95 | # Run, even if the previous jobs were skipped/failed | 99 | # Run, even if the previous jobs were skipped/failed |
| 96 | if: always() | 100 | if: always() |
| 97 | 101 | ||
| 102 | # Override permissions, as this needs to write a check | ||
| 103 | permissions: | ||
| 104 | checks: write | ||
| 105 | contents: read | ||
| 106 | pull-requests: read | ||
| 107 | |||
| 98 | steps: | 108 | steps: |
| 99 | - name: Check Merge Blocking | 109 | - name: Check Merge Blocking |
| 100 | # GitHub Script | 110 | # GitHub Script |
| @@ -7,6 +7,10 @@ on: | |||
| 7 | pull_request_target: | 7 | pull_request_target: |
| 8 | types: [synchronize] | 8 | types: [synchronize] |
| 9 | 9 | ||
| 10 | permissions: | ||
| 11 | contents: read | ||
| 12 | pull-requests: write | ||
| 13 | |||
| 10 | jobs: | 14 | jobs: |
| 11 | check-merge-conflicts: | 15 | check-merge-conflicts: |
| 12 | name: ⚔️ Check Merge Conflicts | 16 | name: ⚔️ Check Merge Conflicts |