Skip to content

Commit 9643901

Browse files
Securely pin versions in GitHub actions (#60)
* Pin commit hashes in github actions * Fix lint * Attempt to fix GitHub Actions workflow --------- Co-authored-by: FluxCapacitor2 <31071265+FluxCapacitor2@users.noreply.github.com>
1 parent 0e789af commit 9643901

9 files changed

Lines changed: 316 additions & 12 deletions

File tree

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Clone repository
13-
uses: actions/checkout@v6
13+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1414

15-
- uses: actions/setup-node@v6
15+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
1616
with:
1717
node-version: 24
1818
cache: "npm"
@@ -31,7 +31,7 @@ jobs:
3131
npm ci
3232
3333
- name: Install Tools
34-
uses: jdx/mise-action@v4
34+
uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1
3535
with:
3636
version: 2026.1.4
3737
install: true

.github/workflows/lint/lint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ check_error
5050

5151
# Ajv: Helm templates
5252
printf "\n======================================\nRunning Ajv (charts/templates)\n======================================\n"
53-
cd "$PROJECT_ROOT/charts/templates" || exit 1
53+
cd "$PROJECT_ROOT/.github/workflows/lint" || exit 1
5454
./validate-templates.sh
5555
check_error
5656

charts/templates/validate-templates.sh renamed to .github/workflows/lint/validate-templates.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/bin/bash
22
set -uo pipefail
33

4+
5+
CURRENT_DIR=$(dirname "$0")
6+
TEMPLATE_DIR="$PWD/$CURRENT_DIR/../../../charts/templates"
7+
cd "$TEMPLATE_DIR" || exit 1
8+
49
tmp="$(mktemp -d)"
510

611
status=0
@@ -10,7 +15,7 @@ for template in *; do
1015
if [[ -d "$template" && -f "$template/Chart.yaml" ]]; then
1116
echo "Validating $template"
1217
yq '.annotations."anvilops-values"' "$template/Chart.yaml" > "$tmp/$template-values.json"
13-
if ! npx --yes ajv-cli@5 test \
18+
if ! npx ajv-cli test \
1419
-s anvilops-values-schema.json \
1520
-d "$tmp/$template-values.json" \
1621
--valid \

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
if: ${{ inputs.environment }}
2626
steps:
2727
- name: Clone repository
28-
uses: actions/checkout@v6
28+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2929

3030
- name: Log in to image registry (Production)
3131
if: ${{ inputs.environment == 'production' }}

.github/workflows/security-scan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Clone repository
14-
uses: actions/checkout@v6
14+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1515

1616
- name: Install Tools
17-
uses: jdx/mise-action@v4
17+
uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1
1818
with:
1919
version: 2026.3.9
2020
install: true

.github/workflows/test-backend.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Clone repository
15-
uses: actions/checkout@v6
15+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1616

17-
- uses: actions/setup-node@v6
17+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
1818
with:
1919
node-version: 24
2020
cache: "npm"

.github/workflows/update-railpack.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
steps:
1717
- name: Clone repository
18-
uses: actions/checkout@v6
18+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1919

2020
- name: Check and Update Version
2121
id: version_check
@@ -54,7 +54,7 @@ jobs:
5454
5555
- name: Create Pull Request
5656
if: steps.version_check.outputs.updated == 'true'
57-
uses: peter-evans/create-pull-request@v8
57+
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
5858
with:
5959
token: ${{ secrets.UPDATE_RAILPACK_GITHUB_TOKEN }}
6060
commit-message: "Update Railpack to ${{ steps.version_check.outputs.new_version }}"

0 commit comments

Comments
 (0)