ci: give every workflow an explicit least-privilege GITHUB_TOKEN

CodeQL actions/missing-workflow-permissions: chain-endpoints.yml, lock.yml, pr-any.yml, test-nightly.yml had no permissions block, so their jobs received the repository default token. Read-only where nothing writes through GITHUB_TOKEN; lock-threads gets the issues/pull-requests/discussions write it documents; workflows that write do it with a separate bot or app token, so GITHUB_TOKEN stays read-only.
This commit is contained in:
Satoshi Qazi Muhammed committed 2026-10-20 22:29:20 +04:00
1 parent 56207e29f5
commit 1a4d109f69
4 files changed
+23

No files matched your search

+6
View File
@@ -6,6 +6,12 @@ on:
# once daily (early mornings, 02:50 GMT, generally not busy)
- cron: '50 2 * * *'
# GITHUB_TOKEN only opens an issue when the endpoint check fails.
permissions:
contents: read
issues: write
jobs:
endpoints:
if: github.repository == 'pezkuwichain/pezkuwi-apps'
+7
View File
@@ -5,6 +5,13 @@ on:
schedule:
- cron: '15 2/3 * * *'
# dessant/lock-threads locks closed issues, PRs and discussions.
permissions:
issues: write
pull-requests: write
discussions: write
jobs:
lock:
runs-on: ubuntu-latest
+5
View File
@@ -1,6 +1,11 @@
name: PR
on: [pull_request]
# Read-only token: no step writes through GITHUB_TOKEN.
permissions:
contents: read
jobs:
pr:
strategy:
+5
View File
@@ -5,6 +5,11 @@ on:
- cron: '1 5 * * *'
# Read-only token: no step writes through GITHUB_TOKEN.
permissions:
contents: read
jobs:
alltests:
strategy: