Skip to content

Commit d0943e7

Browse files
authored
Add Zizmor - Pin commit hashes in GitHub Actions (#31)
* chore: update GitHub Actions to use specific commit hashes for actions * Update pytest dependency to version 9.0.3 in pyproject.toml * chore: update GitHub Actions to use specific version tags for actions * chore: update actions/cache to version 6.0.0 in deploy_mkdocs.yml * chore: set Git remote URL with access token in deploy_mkdocs.yml * chore: update deployment branches in deploy_mkdocs.yml to remove master and specific feature branch
1 parent 0876277 commit d0943e7

7 files changed

Lines changed: 141 additions & 129 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ jobs:
1818
name: Lint and Test
1919
runs-on: ubuntu-22.04
2020
steps:
21-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
22+
with:
23+
persist-credentials: false
2224
- name: Install Poetry
2325
run: pipx install poetry==1.8.3
2426

2527
- name: Set up Python
26-
uses: actions/setup-python@v5
28+
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
2729
with:
2830
python-version-file: .python-version
2931
cache: poetry

.github/workflows/deploy_mkdocs.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,26 @@ name: Deploy MkDocs
44
on:
55
push:
66
branches:
7-
- master
87
- main
98
permissions:
109
contents: write
1110
jobs:
1211
deploy:
1312
runs-on: ubuntu-latest
1413
steps:
15-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
15+
with:
16+
persist-credentials: false
1617
- name: Configure Git Credentials
1718
run: |
1819
git config user.name github-actions[bot]
1920
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
20-
- uses: actions/setup-python@v5
21+
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
22+
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
2123
with:
2224
python-version: 3.x
2325
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
24-
- uses: actions/cache@v4
26+
- uses: actions/cache@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0
2527
with:
2628
key: mkdocs-material-${{ env.cache_id }}
2729
path: .cache

.github/workflows/mega-linter.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ jobs:
6666
steps:
6767
# Git Checkout
6868
- name: Checkout Code
69-
uses: actions/checkout@v4
69+
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
7070
with:
7171
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
72+
persist-credentials: false
7273

7374
# If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to
7475
# improve performance
@@ -85,8 +86,8 @@ jobs:
8586

8687
# You can override MegaLinter flavor used to have faster performances
8788
# More info at https://megalinter.io/latest/flavors/
88-
# The below commit hash is v8.8.0
89-
uses: oxsecurity/megalinter@e08c2b05e3dbc40af4c23f41172ef1e068a7d651
89+
# The below commit hash is v9.5.0
90+
uses: oxsecurity/megalinter@0e3ce9b9c8c10effb9b269509cc47ca17cae31c7
9091

9192
id: ml
9293

@@ -114,7 +115,7 @@ jobs:
114115

115116
# Upload MegaLinter artifacts
116117
- name: Archive production artifacts
117-
uses: actions/upload-artifact@v4
118+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
118119
if: success() || failure()
119120
with:
120121
name: MegaLinter reports
@@ -159,8 +160,11 @@ jobs:
159160
) &&
160161
!contains(github.event.head_commit.message, 'skip fix')
161162
run: |
162-
echo "PR Number - ${{ steps.cpr.outputs.pull-request-number }}"
163-
echo "PR URL - ${{ steps.cpr.outputs.pull-request-url }}"
163+
echo "PR Number - ${PR_NUMBER}"
164+
echo "PR URL - ${PR_URL}"
165+
env:
166+
PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }}
167+
PR_URL: ${{ steps.cpr.outputs.pull-request-url }}
164168

165169
# Push new commit if applicable
166170
# (for now works only on PR from same repository, not from forks)

.mega-linter.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ DISABLE_LINTERS:
4040

4141
SHOW_ELAPSED_TIME: true
4242

43+
ACTION_ZIZMOR_UNSECURED_ENV_VARIABLES:
44+
- GITHUB_TOKEN
45+
4346
FILEIO_REPORTER: false
4447
# Uncomment if you want MegaLinter to detect errors but not block CI to pass
4548
# DISABLE_ERRORS: true

concourse/scripts/terraform_infra.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ lambda_memory=$(echo "$secrets" | jq -r .lambda_memory)
2525
export AWS_ACCESS_KEY_ID="$aws_access_key_id"
2626
export AWS_SECRET_ACCESS_KEY="$aws_secret_access_key"
2727

28+
# kingfisher:ignore
2829
git config --global url."https://x-access-token:$github_access_token@github.com/".insteadOf "https://github.com/"
2930

3031
if [ "${env}" != "prod" ]; then

0 commit comments

Comments
 (0)