Skip to content

Commit 8fc4be1

Browse files
authored
πŸ¦… [gha] improve security (#52)
* πŸ¦… [gha] improve security * add actionlint * restrict github-pages-overwriter similarly to others
1 parent ee33b39 commit 8fc4be1

File tree

5 files changed

+33
-4
lines changed

5 files changed

+33
-4
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Lint GitHub Actions workflows
2+
3+
on:
4+
# Triggers the workflow on push or pull request events but only for the "main" branch
5+
push:
6+
branches: [ "main" ]
7+
pull_request:
8+
branches: [ "main" ]
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
# global permissions
14+
permissions: {}
15+
16+
jobs:
17+
actionlint:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Check workflow files
24+
uses: docker://rhysd/actionlint:latest
25+
with:
26+
args: -color

β€Ž.github/workflows/auto-assign.ymlβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ on:
77
types: [opened]
88

99
# global permissions
10-
permissions: read-all
10+
permissions: {}
1111

1212
jobs:
1313
run:
1414
runs-on: ubuntu-latest
1515
permissions:
1616
issues: write
1717
pull-requests: write
18+
contents: read
1819
steps:
1920
- name: 'Auto-assign issue'
2021
uses: pozil/auto-assign-issue@v2

β€Ž.github/workflows/checkov.ymlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
workflow_dispatch:
1313

1414
# global permissions
15-
permissions: read-all
15+
permissions: {}
1616

1717
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1818
jobs:

β€Ž.github/workflows/github-pages.ymlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'main'
77

88
# global permissions
9-
permissions: read-all
9+
permissions: {}
1010

1111
jobs:
1212
publish:

β€Ž.github/workflows/markdownlint.ymlβ€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ on:
77
pull_request:
88

99
# global permissions
10-
permissions: read-all
10+
permissions: {}
1111

1212
jobs:
1313
lint:
1414
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
1517
steps:
1618
- uses: actions/checkout@v4
1719
- uses: DavidAnson/markdownlint-cli2-action@v19

0 commit comments

Comments
Β (0)