Skip to content

Commit 5783d61

Browse files
authored
merge PR #50 Implement StepSecurity Secure Workflows
PR: Implement StepSecurity Secure Workflows
2 parents 7cdc061 + 7ede3df commit 5783d61

File tree

6 files changed

+85
-16
lines changed

6 files changed

+85
-16
lines changed

.github/workflows/assign-to-project.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,45 @@ on:
88
env:
99
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
assign-to-project:
16+
permissions:
17+
repository-projects: write # for srggrs/assign-one-project-github-action to assign issues and PRs to repo project
1318
runs-on: ubuntu-latest
1419
name: Assign to Project
1520
steps:
21+
22+
- name: Harden Runner
23+
uses: step-security/harden-runner@74b568e8591fbb3115c70f3436a0c6b0909a8504
24+
with:
25+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
26+
1627
- name: Assign Issues to Bugs
17-
uses: srggrs/assign-one-project-github-action@1.3.1
28+
uses: srggrs/assign-one-project-github-action@4d59cc619499b55ca689fb13cfcc72324a8b8435
1829
if: contains(github.event.issue.labels.*.name, 'bug')
1930
with:
2031
project: 'https://github.com/irongut/CodeCoverageSummary/projects/1'
2132
column_name: 'Needs triage'
2233

2334
- name: Assign Issues to Enhancements
24-
uses: srggrs/assign-one-project-github-action@1.3.1
35+
uses: srggrs/assign-one-project-github-action@4d59cc619499b55ca689fb13cfcc72324a8b8435
2536
if: contains(github.event.issue.labels.*.name, 'enhancement')
2637
with:
2738
project: 'https://github.com/irongut/CodeCoverageSummary/projects/2'
2839
column_name: 'To do'
2940

3041
- name: Assign PRs to Bugs
31-
uses: srggrs/assign-one-project-github-action@1.3.1
42+
uses: srggrs/assign-one-project-github-action@4d59cc619499b55ca689fb13cfcc72324a8b8435
3243
if: contains(github.event.pull_request.labels.*.name, 'bug')
3344
with:
3445
project: 'https://github.com/irongut/CodeCoverageSummary/projects/1'
3546
column_name: 'In Progress'
3647

3748
- name: Assign PRs to Enhancements
38-
uses: srggrs/assign-one-project-github-action@1.3.1
49+
uses: srggrs/assign-one-project-github-action@4d59cc619499b55ca689fb13cfcc72324a8b8435
3950
if: contains(github.event.pull_request.labels.*.name, 'enhancement')
4051
with:
4152
project: 'https://github.com/irongut/CodeCoverageSummary/projects/2'

.github/workflows/auto-assign-pr.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,22 @@ on:
77
pull_request:
88
types: [opened]
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
assignAuthor:
15+
permissions:
16+
issues: write # for samspills/assign-pr-to-author
1217
runs-on: ubuntu-latest
1318
steps:
19+
20+
- name: Harden Runner
21+
uses: step-security/harden-runner@74b568e8591fbb3115c70f3436a0c6b0909a8504
22+
with:
23+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
24+
1425
- name: Auto Assign PR
15-
uses: samspills/assign-pr-to-author@v1.0.1
26+
uses: samspills/assign-pr-to-author@223a87a821f7e7447cfb5221bc53ceeb633341c2
1627
with:
1728
repo-token: '${{ secrets.GITHUB_TOKEN }}'

.github/workflows/ci-build.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,25 @@ on:
66
pull_request:
77
branches: [ master ]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
build:
1114
runs-on: ubuntu-latest
1215
name: CI Build
1316
steps:
17+
18+
- name: Harden Runner
19+
uses: step-security/harden-runner@74b568e8591fbb3115c70f3436a0c6b0909a8504
20+
with:
21+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
22+
1423
- name: Checkout
15-
uses: actions/checkout@v2
24+
uses: actions/checkout@d171c3b028d844f2bf14e9fdec0c58114451e4bf
1625

1726
- name: Setup .Net
18-
uses: actions/setup-dotnet@v1
27+
uses: actions/setup-dotnet@608ee757cfcce72c2e91e99aca128e0cae67de87
1928
with:
2029
dotnet-version: 6.0.x
2130

.github/workflows/mark-stale.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,25 @@ on:
44
schedule:
55
- cron: "30 1 * * *"
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
stale:
912

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
11-
1217
steps:
18+
19+
- name: Harden Runner
20+
uses: step-security/harden-runner@74b568e8591fbb3115c70f3436a0c6b0909a8504
21+
with:
22+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
23+
1324
- name: Mark Stale
14-
uses: actions/stale@v3
25+
uses: actions/stale@98ed4cb500039dbcccf4bd9bedada4d0187f2757
1526
with:
1627
repo-token: ${{ secrets.GITHUB_TOKEN }}
1728
exempt-all-milestones: true

.github/workflows/pr-labeler.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,22 @@ name: PR Labeler
77
on:
88
pull_request_target:
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
label:
15+
permissions:
16+
contents: read # for actions/labeler to determine modified files
17+
pull-requests: write # for actions/labeler to add labels to PRs
1218
runs-on: ubuntu-latest
1319
steps:
14-
- uses: actions/labeler@v3
20+
21+
- name: Harden Runner
22+
uses: step-security/harden-runner@74b568e8591fbb3115c70f3436a0c6b0909a8504
23+
with:
24+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
25+
26+
- uses: actions/labeler@472c5d3aaacde439785e94966eb2e545627f4935
1527
with:
1628
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/release-build.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,27 @@ env:
88
REGISTRY: ghcr.io
99
IMAGE_NAME: ${{ github.repository }}
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
build:
1316
name: Test Build
1417
runs-on: ubuntu-latest
1518
steps:
19+
20+
- name: Harden Runner
21+
uses: step-security/harden-runner@74b568e8591fbb3115c70f3436a0c6b0909a8504
22+
with:
23+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
24+
1625
- name: Checkout
17-
uses: actions/checkout@v2
26+
uses: actions/checkout@d171c3b028d844f2bf14e9fdec0c58114451e4bf
1827
with:
1928
fetch-depth: 0
2029

2130
- name: Setup .Net
22-
uses: actions/setup-dotnet@v1
31+
uses: actions/setup-dotnet@608ee757cfcce72c2e91e99aca128e0cae67de87
2332
with:
2433
dotnet-version: 6.0.x
2534

@@ -40,24 +49,30 @@ jobs:
4049
contents: read
4150
packages: write
4251
steps:
52+
53+
- name: Harden Runner
54+
uses: step-security/harden-runner@74b568e8591fbb3115c70f3436a0c6b0909a8504
55+
with:
56+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
57+
4358
- name: Checkout
44-
uses: actions/checkout@v2
59+
uses: actions/checkout@d171c3b028d844f2bf14e9fdec0c58114451e4bf
4560

4661
- name: Login to GitHub Container Registry
47-
uses: docker/login-action@v1
62+
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7
4863
with:
4964
registry: ${{ env.REGISTRY }}
5065
username: ${{ github.repository_owner }}
5166
password: ${{ secrets.GITHUB_TOKEN }}
5267

5368
- name: Extract Docker metadata
5469
id: meta
55-
uses: docker/metadata-action@v3
70+
uses: docker/metadata-action@b2391d37b4157fa4aa2e118d643f417910ff3242
5671
with:
5772
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
5873

5974
- name: Build + Push Docker image
60-
uses: docker/build-push-action@v2
75+
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
6176
with:
6277
context: .
6378
push: true

0 commit comments

Comments
 (0)