Skip to content

Commit 72d2aa3

Browse files
step-security-botMaxymVlasov
authored andcommitted
[StepSecurity] ci: Harden GitHub Actions
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
1 parent 9a68d89 commit 72d2aa3

File tree

5 files changed

+23
-0
lines changed

5 files changed

+23
-0
lines changed

.github/workflows/build-image.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
schedule:
1111
- cron: 00 00 * * *
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
docker:
1518
runs-on: ubuntu-latest

.github/workflows/pr-title.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@ on:
99
- edited
1010
- synchronize
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
main:
17+
permissions:
18+
pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs
19+
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR
1420
name: Validate PR title
1521
runs-on: ubuntu-latest
1622
steps:

.github/workflows/pre-commit.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ name: Common issues check
44

55
on: [pull_request]
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
pre-commit:
12+
permissions:
13+
contents: write # for pre-commit/action to push back fixes to PR branch
914
runs-on: ubuntu-latest
1015
steps:
1116
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414
- .pre-commit-hooks.yaml
1515
# Ignore paths
1616
- '!tests/**'
17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
release:
1922
name: Release

.github/workflows/stale-actions.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ on:
55
schedule:
66
- cron: 0 0 * * *
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

0 commit comments

Comments
 (0)