Skip to content

Commit 31c3714

Browse files
authored
Merge pull request #204 from jmeridth/update-actions-sha-pins
ci: pin actions to SHAs and harden workflows
2 parents c4e7453 + d18c5eb commit 31c3714

2 files changed

Lines changed: 23 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,25 @@ on:
66
- "dependabot/**"
77
pull_request:
88

9-
permissions:
10-
contents: read
9+
permissions: {}
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
13+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
1114

1215
jobs:
1316
lint:
1417
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read # Clone the repository
1520
steps:
16-
- uses: actions/checkout@v6
17-
- uses: actions/setup-node@v6
21+
- uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
22+
with:
23+
egress-policy: audit
24+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
25+
with:
26+
persist-credentials: false
27+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
1828
with:
1929
cache: npm
2030
- name: Install dependencies

.github/workflows/contributors.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,20 @@ on:
44
schedule:
55
- cron: "3 2 1 * *"
66

7-
permissions:
8-
discussions: write
7+
permissions: {}
98

109
jobs:
1110
contributor_report:
1211
name: contributor reports
1312
runs-on: ubuntu-latest
13+
permissions:
14+
discussions: write # Create the monthly thank-you discussion via abirismyname/create-discussion
1415

1516
steps:
17+
- uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
18+
with:
19+
egress-policy: audit
20+
1621
- name: Get dates for last month
1722
shell: bash
1823
run: |
@@ -27,7 +32,7 @@ jobs:
2732
echo "END_DATE=$end_date" >> "$GITHUB_ENV"
2833
2934
- name: Run contributor action
30-
uses: github-community-projects/contributors@v2
35+
uses: github-community-projects/contributors@4fda46a62ca1f1f1162c053c11d9576ae0cdda99 # v2.0.15
3136
env:
3237
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3338
START_DATE: ${{ env.START_DATE }}
@@ -37,7 +42,7 @@ jobs:
3742
LINK_TO_PROFILE: "true"
3843

3944
- name: Create GitHub Discussion
40-
uses: abirismyname/create-discussion@v2.1.0
45+
uses: abirismyname/create-discussion@c2b7c825241769dda523865ae444a879f6bbd0e0 # v2.1.0
4146
env:
4247
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4348
with:

0 commit comments

Comments
 (0)