Skip to content

Commit 05f1a2c

Browse files
[StepSecurity] ci: Harden GitHub Actions (#305)
Signed-off-by: StepSecurity Bot <[email protected]>
1 parent 7266b5c commit 05f1a2c

File tree

8 files changed

+29
-0
lines changed

8 files changed

+29
-0
lines changed

.github/workflows/dco.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
dco_check:
13+
permissions:
14+
pull-requests: read # for tim-actions/get-pr-commits to get list of commits from the PR
1015
runs-on: ubuntu-latest
1116
name: DCO Check
1217
steps:

.github/workflows/doc-only.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
branches:
1313
- main
1414

15+
permissions:
16+
contents: read
17+
1518
jobs:
1619
verify:
1720
name: verify

.github/workflows/e2e.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ env:
1616
GO_VERSION: '1.20'
1717
GO_REQUIRED_MIN_VERSION: ''
1818

19+
permissions:
20+
contents: read
21+
1922
jobs:
2023
e2e:
2124
runs-on: ubuntu-latest

.github/workflows/post.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ env:
1616
GO_VERSION: '1.20'
1717
GO_REQUIRED_MIN_VERSION: ''
1818

19+
permissions:
20+
contents: read
21+
1922
jobs:
2023
coverage:
2124
name: coverage

.github/workflows/pr-verify.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
pull_request_target:
99
types: [opened, edited, reopened, synchronize]
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
verify:
1316
name: verify PR contents

.github/workflows/pre.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ env:
1616
GO_VERSION: '1.20'
1717
GO_REQUIRED_MIN_VERSION: ''
1818

19+
permissions:
20+
contents: read
21+
1922
jobs:
2023
verify:
2124
name: verify

.github/workflows/releaseimage.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ defaults:
1515
run:
1616
working-directory: go/src/open-cluster-management.io/ocm
1717

18+
permissions:
19+
contents: read
20+
1821
jobs:
1922
env:
2023
name: prepare release env

.github/workflows/stable.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ on:
55

66
# `stable` label will be added to issues and PRs that have been inactive for 120 days
77
# Close stale issues and PRs after 14 days of inactivity
8+
permissions:
9+
contents: read
10+
811
jobs:
912
stale:
13+
permissions:
14+
issues: write # for actions/stale to close stale issues
15+
pull-requests: write # for actions/stale to close stale PRs
1016
runs-on: ubuntu-latest
1117
steps:
1218
- uses: actions/stale@v8

0 commit comments

Comments
 (0)