Skip to content

Commit 3d88cae

Browse files
authored
Add permission matrices to all Actions workflows (#23563)
* Add permission matrices to all Actions workflows Also cleanup a few token references * Add actions:read permissions for CodeQL * Add prs:read permissions for unit test workflow
1 parent 41c7f58 commit 3d88cae

File tree

56 files changed

+174
-26
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+174
-26
lines changed

.github/workflows/60-days-stale-check.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
schedule:
99
- cron: '40 16 * * *' # Run each day at 16:40 UTC / 8:40 PST
1010

11+
permissions:
12+
issues: write
13+
pull-requests: write
14+
1115
jobs:
1216
stale:
1317
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'

.github/workflows/add-review-template.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
types:
1010
- labeled
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
comment-that-approved:
1417
name: Add review template

.github/workflows/auto-label-prs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ name: Auto label Pull Requests
77
on:
88
pull_request:
99

10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
1014
jobs:
1115
triage:
1216
if: github.repository == 'github/docs-internal'

.github/workflows/autoupdate-branch.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ on:
2424
branches:
2525
- main
2626

27+
permissions:
28+
contents: read
29+
2730
jobs:
2831
autoupdate:
2932
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'

.github/workflows/browser-test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ on:
2222
# Ultimately, for debugging this workflow itself
2323
- .github/workflows/browser-test.yml
2424

25+
permissions:
26+
contents: read
27+
2528
jobs:
2629
build:
2730
runs-on: ubuntu-latest

.github/workflows/check-all-english-links.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
schedule:
1010
- cron: '40 19 * * *' # once a day at 19:40 UTC / 11:40 PST
1111

12+
permissions:
13+
contents: read
14+
issues: write
15+
1216
jobs:
1317
check_all_english_links:
1418
name: Check all links

.github/workflows/check-broken-links-github-github.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
schedule:
1010
- cron: '20 13 * * 1' # run every Monday at 1:20PM UTC
1111

12+
permissions:
13+
contents: read
14+
1215
# **IMPORTANT:** Do not change the FREEZE environment variable set here!
1316
# This workflow runs on a recurring basis. To temporarily disable it (e.g.,
1417
# during a docs deployment freeze), add an Actions Secret to the repo settings

.github/workflows/check-for-spammy-issues.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ name: Check for Spammy Issues
77
on:
88
issues:
99
types: [opened]
10+
11+
permissions:
12+
contents: none
13+
1014
jobs:
1115
spammy-title-check:
1216
name: Remove issues with spammy titles

.github/workflows/code-lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ name: Lint code
44
# **Why we have it**: We want some level of consistency to our code.
55
# **Who does it impact**: Docs engineering, open-source engineering contributors.
66

7-
permissions:
8-
contents: read
9-
107
on:
118
workflow_dispatch:
129
push:
@@ -26,6 +23,9 @@ on:
2623
# Ultimately, for debugging this workflow itself
2724
- .github/workflows/code-lint.yml
2825

26+
permissions:
27+
contents: read
28+
2929
jobs:
3030
lint:
3131
runs-on: ubuntu-latest

.github/workflows/codeql.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
- '**/*.js'
1616
- '.github/workflows/codeql.yml'
1717

18+
permissions:
19+
actions: read
20+
contents: read
21+
1822
jobs:
1923
build:
2024
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'

0 commit comments

Comments
 (0)