Skip to content

Commit 7c5b9ef

Browse files
authored
Merge pull request #6818 from sbueringer/pr-restrict-github-actions-perms
🌱 Restrict permissions of GitHub actions
2 parents cd22809 + abb2351 commit 7c5b9ef

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
lines changed

.github/workflows/dependabot.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
- dependabot/**
1010
workflow_dispatch:
1111

12+
permissions:
13+
contents: write # Allow to update the PR.
14+
1215
jobs:
1316
build:
1417
name: Build

.github/workflows/golangci-lint.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
name: golangci-lint
2+
23
on:
34
pull_request:
45
types: [opened, edited, synchronize, reopened]
6+
7+
# Remove all permissions from GITHUB_TOKEN except metadata.
8+
permissions: {}
9+
510
jobs:
611
golangci:
712
name: lint

.github/workflows/lint-docs.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
paths:
77
- '**.md'
88

9+
# Remove all permissions from GITHUB_TOKEN except metadata.
10+
permissions: {}
11+
912
jobs:
1013
markdown-link-check:
1114
name: Broken Links
@@ -15,4 +18,4 @@ jobs:
1518
- uses: gaurav-nelson/github-action-markdown-link-check@v1
1619
with:
1720
use-quiet-mode: 'yes'
18-
config-file: .markdownlinkcheck.json
21+
config-file: .markdownlinkcheck.json

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
name: release
2+
13
on:
24
push:
35
# Sequence of patterns matched against refs/tags
46
tags:
57
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
68

7-
name: release
9+
permissions:
10+
contents: write # Allow to create a release.
811

912
jobs:
1013
build:

.github/workflows/verify.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
name: verify
2+
13
on:
24
pull_request_target:
35
types: [opened, edited, synchronize, reopened]
46

7+
permissions:
8+
checks: write # Allow access to checks to write check runs.
9+
510
jobs:
611
verify:
712
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)