Skip to content

Commit b7acc21

Browse files
chore(ci): enforce zero trust for third party workflows (#2215)
Co-authored-by: Leandro Damascena <leandro.damascena@gmail.com>
1 parent 0ab3b70 commit b7acc21

20 files changed

+58
-110
lines changed

.github/workflows/auto-merge.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ jobs:
2323

2424
steps:
2525
- name: Checkout repository
26-
uses: actions/checkout@v3
26+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
2727

2828
# Initializes the CodeQL tools for scanning.
2929
- name: Initialize CodeQL
30-
uses: github/codeql-action/init@v2
30+
uses: github/codeql-action/init@f31a31c052207cc13b328d6295c5b728bb49568c # v2.13.1
3131
with:
3232
languages: ${{ matrix.language }}
3333
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -36,4 +36,4 @@ jobs:
3636
# queries: ./path/to/local/query, your-org/your-repo/queries@main
3737

3838
- name: Perform CodeQL Analysis
39-
uses: github/codeql-action/analyze@v2
39+
uses: github/codeql-action/analyze@f31a31c052207cc13b328d6295c5b728bb49568c # v2.13.1

.github/workflows/dispatch_analytics.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
environment: analytics
3030
steps:
3131
- name: Configure AWS credentials
32-
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef
32+
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0
3333
with:
3434
aws-region: eu-central-1
3535
role-to-assume: ${{ secrets.AWS_ANALYTICS_ROLE_ARN }}

.github/workflows/label_pr_on_title.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- name: Checkout repository
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
2626
- name: "Label PR based on title"
27-
uses: actions/github-script@v6
27+
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
2828
env:
2929
PR_NUMBER: ${{ needs.get_pr_details.outputs.prNumber }}
3030
PR_TITLE: ${{ needs.get_pr_details.outputs.prTitle }}

.github/workflows/on_closed_issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
auto_comment:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: aws-actions/closed-issue-message@v1
9+
- uses: aws-actions/closed-issue-message@8b6324312193476beecf11f8e8539d73a3553bf4
1010
with:
1111
repo-token: "${{ secrets.GITHUB_TOKEN }}"
1212
message: |

.github/workflows/on_label_added.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
issues: write
2424
pull-requests: write
2525
steps:
26-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
2727
# Maintenance: Persist state per PR as an artifact to avoid spam on label add
2828
- name: "Suggest split large Pull Request"
29-
uses: actions/github-script@v6
29+
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
3030
env:
3131
PR_NUMBER: ${{ needs.get_pr_details.outputs.prNumber }}
3232
PR_ACTION: ${{ needs.get_pr_details.outputs.prAction }}

.github/workflows/on_merged_pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
runs-on: ubuntu-latest
2121
if: needs.get_pr_details.outputs.prIsMerged == 'true'
2222
steps:
23-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
2424
- name: "Label PR related issue for release"
25-
uses: actions/github-script@v6
25+
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
2626
env:
2727
PR_NUMBER: ${{ needs.get_pr_details.outputs.prNumber }}
2828
PR_BODY: ${{ needs.get_pr_details.outputs.prBody }}

.github/workflows/on_opened_pr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ jobs:
1919
needs: get_pr_details
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
2323
- name: "Ensure related issue is present"
24-
uses: actions/github-script@v6
24+
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
2525
env:
2626
PR_BODY: ${{ needs.get_pr_details.outputs.prBody }}
2727
PR_NUMBER: ${{ needs.get_pr_details.outputs.prNumber }}
@@ -36,9 +36,9 @@ jobs:
3636
needs: get_pr_details
3737
runs-on: ubuntu-latest
3838
steps:
39-
- uses: actions/checkout@v3
39+
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
4040
- name: "Ensure acknowledgement section is present"
41-
uses: actions/github-script@v6
41+
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
4242
env:
4343
PR_BODY: ${{ needs.get_pr_details.outputs.prBody }}
4444
PR_NUMBER: ${{ needs.get_pr_details.outputs.prNumber }}

.github/workflows/publish_v2_layer.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ jobs:
3838
working-directory: ./layer
3939
steps:
4040
- name: checkout
41-
uses: actions/checkout@v3
41+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
4242
with:
4343
fetch-depth: 0
4444
- name: Install poetry
4545
run: pipx install poetry
4646
- name: Setup Node.js
47-
uses: actions/setup-node@v3
47+
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
4848
with:
4949
node-version: "16.12"
5050
- name: Setup python
51-
uses: actions/setup-python@v4
51+
uses: actions/setup-python@57ded4d7d5e986d7296eab16560982c6dd7c923b # v4.6.0
5252
with:
5353
python-version: "3.10"
5454
cache: "pip"
@@ -80,7 +80,7 @@ jobs:
8080
- name: zip output
8181
run: zip -r cdk.out.zip cdk.out
8282
- name: Archive CDK artifacts
83-
uses: actions/upload-artifact@v3
83+
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
8484
with:
8585
name: cdk-layer-artefact
8686
path: layer/cdk.out.zip

.github/workflows/python_build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ jobs:
3232
env:
3333
PYTHON: "${{ matrix.python-version }}"
3434
steps:
35-
- uses: actions/checkout@v3
35+
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
3636
- name: Install poetry
3737
run: pipx install poetry
3838
- name: Set up Python ${{ matrix.python-version }}
39-
uses: actions/setup-python@v4
39+
uses: actions/setup-python@57ded4d7d5e986d7296eab16560982c6dd7c923b # v4.6.0
4040
with:
4141
python-version: ${{ matrix.python-version }}
4242
cache: "poetry"

0 commit comments

Comments
 (0)