Skip to content

Commit 8bf1dd2

Browse files
authored
ci: pin actions workflow step hashes and use minimum permissions (#125)
1 parent f7915fb commit 8bf1dd2

File tree

4 files changed

+44
-23
lines changed

4 files changed

+44
-23
lines changed

.github/workflows/deno.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ name: Deno Format, Lint and Unit Tests
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches:
6+
- main
67
pull_request:
7-
branches: [ main ]
8+
branches:
9+
- main
810

911
jobs:
1012
test:
@@ -14,19 +16,23 @@ jobs:
1416
# we test on both most recent stable version of deno (v1.x) as well as
1517
# the version of deno used by Run on Slack (as noted in https://api.slack.com/slackcli/metadata.json)
1618
deno-version: [v1.x, v1.45.4]
19+
permissions:
20+
contents: read
1721
steps:
1822
- name: Setup repo
19-
uses: actions/checkout@v4
23+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
with:
25+
persist-credentials: false
2026
- name: Setup Deno
21-
uses: denoland/setup-deno@v2
27+
uses: denoland/setup-deno@e95548e56dfa95d4e1a28d6f422fafe75c4c26fb # v2.0.3
2228
with:
2329
deno-version: ${{ matrix.deno-version }}
2430
- name: Run formatter, linter and tests
2531
run: deno task test
2632
- name: Generate CodeCov-friendly coverage report
2733
run: deno task generate-lcov
2834
- name: Upload coverage to CodeCov
29-
uses: codecov/codecov-action@v5
35+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
3036
with:
3137
file: ./lcov.info
3238
token: ${{ secrets.CODECOV_TOKEN }}
@@ -35,12 +41,15 @@ jobs:
3541
needs: test
3642
permissions:
3743
checks: write
44+
contents: read
3845
runs-on: ubuntu-latest
3946
steps:
4047
- name: Setup repo
41-
uses: actions/checkout@v4
48+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
49+
with:
50+
persist-credentials: false
4251
- name: Report health score
43-
uses: slackapi/slack-health-score@v0
52+
uses: slackapi/slack-health-score@d58a419f15cdaff97e9aa7f09f95772830ab66f7 # v0.1.1
4453
with:
4554
codecov_token: ${{ secrets.FILS_CODECOV_API_TOKEN }}
4655
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/npm.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,31 @@ name: NPM Build
44

55
on:
66
push:
7-
branches: [ main ]
7+
branches:
8+
- main
89
pull_request:
9-
branches: [ main ]
10+
branches:
11+
- main
1012

1113
jobs:
1214
build:
1315
runs-on: macos-latest
14-
16+
permissions:
17+
contents: read
1518
steps:
1619
- name: Actions checkout
17-
uses: actions/checkout@v4
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
with:
22+
persist-credentials: false
1823

1924
- name: Setup node
20-
uses: actions/setup-node@v4
25+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2126
with:
2227
node-version: latest
2328
registry-url: https://registry.npmjs.org/
2429

2530
- name: Setup Deno
26-
uses: denoland/setup-deno@v2
31+
uses: denoland/setup-deno@e95548e56dfa95d4e1a28d6f422fafe75c4c26fb # v2.0.3
2732
with:
2833
deno-version: v1.x
2934

.github/workflows/publish.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ name: Publish
33
on:
44
push:
55
tags:
6-
- '*'
6+
- "*"
77

88
jobs:
99
publish:
1010
runs-on: ubuntu-latest
1111
permissions:
1212
contents: read
13-
id-token: write # The OIDC ID token is used for authentication with JSR.
13+
id-token: write # The OIDC ID token is used for authentication with JSR.
1414
steps:
15-
- uses: actions/checkout@v4
16-
- run: npx jsr publish
15+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
with:
17+
persist-credentials: false
18+
- run: npx jsr publish

.github/workflows/samples.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ name: Samples Integration Type-checking
33

44
on:
55
push:
6-
branches: [main]
6+
branches:
7+
- main
78
pull_request:
8-
branches: [main]
9+
branches:
10+
- main
911

1012
jobs:
1113
samples:
@@ -22,22 +24,25 @@ jobs:
2224
# we test on both most recent stable version of deno (v1.x) as well as
2325
# the version of deno used by Run on Slack (as noted in https://api.slack.com/slackcli/metadata.json)
2426
deno-version: [v1.x, v1.45.4]
25-
27+
permissions:
28+
contents: read
2629
steps:
2730
- name: Setup Deno ${{ matrix.deno-version }}
28-
uses: denoland/setup-deno@v2
31+
uses: denoland/setup-deno@e95548e56dfa95d4e1a28d6f422fafe75c4c26fb # v2.0.3
2932
with:
3033
deno-version: ${{ matrix.deno-version }}
3134

3235
- name: Checkout the api
33-
uses: actions/checkout@v4
36+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3437
with:
3538
path: ./deno-slack-api
39+
persist-credentials: false
3640
- name: Checkout the ${{ matrix.sample }} sample
37-
uses: actions/checkout@v4
41+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3842
with:
3943
repository: ${{ matrix.sample }}
4044
path: ./sample
45+
persist-credentials: false
4146

4247
- name: Set imports.deno-slack-api/ to ../deno-slack-api/src/ in import_map.json
4348
run: >

0 commit comments

Comments
 (0)