Skip to content

Commit 3aa5488

Browse files
[StepSecurity] ci: Harden GitHub Actions (#1702)
Signed-off-by: StepSecurity Bot <[email protected]>
1 parent 2c8ea61 commit 3aa5488

7 files changed

+32
-0
lines changed

.github/workflows/backport.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ on:
66
description: "The pull request # to backport"
77
required: true
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
backport:
14+
permissions:
15+
contents: write # for Git to git push
1116
runs-on: ubuntu-latest
1217
steps:
1318
- run: |

.github/workflows/issue-management-stale-action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ on:
55
# hourly at minute 23
66
- cron: "23 * * * *"
77

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@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0

.github/workflows/prepare-patch-release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@ name: Prepare patch release
22
on:
33
workflow_dispatch:
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
prepare-patch-release:
10+
permissions:
11+
contents: write # for Git to git push
712
runs-on: ubuntu-latest
813
steps:
914
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/prepare-release-branch.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Prepare release branch
22
on:
33
workflow_dispatch:
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
prereqs:
710
runs-on: ubuntu-latest
@@ -21,6 +24,8 @@ jobs:
2124
fi
2225
2326
create-pull-request-against-release-branch:
27+
permissions:
28+
contents: write # for Git to git push
2429
runs-on: ubuntu-latest
2530
needs:
2631
- prereqs
@@ -70,6 +75,8 @@ jobs:
7075
--base $RELEASE_BRANCH_NAME
7176
7277
create-pull-request-against-main:
78+
permissions:
79+
contents: write # for Git to git push
7380
runs-on: ubuntu-latest
7481
needs:
7582
- prereqs

.github/workflows/reusable-markdown-lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Reusable - Markdown lint check
33
on:
44
workflow_call:
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
markdown-lint-check:
811
runs-on: ubuntu-latest

.github/workflows/reusable-misspell-check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Reusable - Misspell check
33
on:
44
workflow_call:
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
misspell-check:
811
runs-on: ubuntu-latest

.github/workflows/reusable-shell-script-check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Reusable - Shell script check
33
on:
44
workflow_call:
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
shell-script-check:
811
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)