Skip to content

Commit 589dd56

Browse files
Pin GitHub Actions and narrow permissions (#892)
1 parent b61073a commit 589dd56

2 files changed

Lines changed: 42 additions & 6 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,24 @@ on:
66
pull_request:
77
workflow_dispatch:
88

9+
permissions: {}
10+
911
jobs:
1012
check-signoff:
1113
if: "github.event_name == 'pull_request'"
12-
uses: "matrix-org/backend-meta/.github/workflows/sign-off.yml@v2"
14+
permissions:
15+
pull-requests: read
16+
uses: matrix-org/backend-meta/.github/workflows/sign-off.yml@18beaf3c8e536108bd04d18e6c3dc40ba3931e28 # v2
1317

1418
complement-internal:
1519
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
1622
steps:
17-
- uses: actions/checkout@v6.0.3 # Checkout complement
18-
- uses: actions/setup-go@v6.5.0
23+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
24+
with:
25+
persist-credentials: false
26+
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
1927
with:
2028
go-version-file: go.mod
2129
- name: "Run internal Complement tests"
@@ -35,6 +43,8 @@ jobs:
3543
complement:
3644
name: Complement (${{ matrix.homeserver }})
3745
runs-on: ubuntu-latest
46+
permissions:
47+
contents: read
3848
strategy:
3949
fail-fast: false # ensure if synapse fails we keep running dendrite and vice-versa
4050
matrix:
@@ -54,9 +64,11 @@ jobs:
5464
timeout: 10m
5565

5666
steps:
57-
- uses: actions/checkout@v6.0.3 # Checkout complement
67+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
68+
with:
69+
persist-credentials: false
5870

59-
- uses: actions/setup-go@v6.5.0
71+
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
6072
with:
6173
go-version-file: go.mod
6274

@@ -66,7 +78,7 @@ jobs:
6678
# servers which listen on random high numbered ports.
6779
- name: "Install Complement Dependencies"
6880
run: |
69-
go install -v github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
81+
go install -v github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@v2.5.0
7082
mkdir .gotestfmt/github -p
7183
cp .ci/complement_package.gotpl .gotestfmt/github/package.gotpl
7284
gotestfmt -help

.github/workflows/zizmor.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Taken from https://github.com/zizmorcore/zizmor-action/blob/f72bf176f67e8007f87b16d80f9880ece648aa65/README.md
2+
name: GitHub Actions Security Analysis with zizmor 🌈
3+
4+
on:
5+
push:
6+
branches: ["main"]
7+
pull_request:
8+
branches: ["**"]
9+
10+
permissions: {}
11+
12+
jobs:
13+
zizmor:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
security-events: write
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
20+
with:
21+
persist-credentials: false
22+
23+
- name: Run zizmor 🌈
24+
uses: zizmorcore/zizmor-action@192e21d79ab29983730a13d1382995c2307fbcaa # v0.5.7

0 commit comments

Comments
 (0)