Skip to content

Commit

Permalink
chore(ci): Pin action dependencies by digest (redwoodjs#11395)
Browse files Browse the repository at this point in the history
It is considered a best practice to pin github actions by the actual
digest rather than by tag - given that tags are mutable.

There's a convenient tool
[pin-github-action](https://github.com/mheap/pin-github-action) that has
a CLI that can take a file and do this for us. I used this here and
ensured that I had the comments in the form that renovate will
understand. Renovate will trigger updates for the digest when a new
version (based on the comment) is published
[(docs)](https://docs.renovatebot.com/modules/manager/github-actions/#additional-information).

This might make working with actions slightly harder than it was before
but we often use the same actions repeatedly so in that case just copy
paste the digest from somewhere else. If you're adding a new one use the
version tag and then run that tool mentioned above.
  • Loading branch information
Josh-Walker-GM authored Aug 30, 2024
1 parent 9292ec5 commit 14244d9
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
name: 📝 Check changesets
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up job
uses: ./.github/actions/set-up-job
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-create-redwood-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: Check create redwood app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up job
uses: ./.github/actions/set-up-job
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-test-project-fixture.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
ssr: ${{ steps.detect-changes.outputs.ssr }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up job
uses: ./.github/actions/set-up-job
with:
Expand All @@ -44,7 +44,7 @@ jobs:
permissions:
actions: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- name: Set up job
if: "!contains(github.event.pull_request.labels.*.name, 'fixture-ok')"
Expand Down
40 changes: 20 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
ssr: ${{ steps.detect-changes.outputs.ssr }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up job
uses: ./.github/actions/set-up-job
with:
Expand All @@ -47,7 +47,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up job
uses: ./.github/actions/set-up-job
with:
Expand All @@ -73,7 +73,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up job
uses: ./.github/actions/set-up-job
with:
Expand All @@ -99,7 +99,7 @@ jobs:
if: matrix.os != 'ubuntu-latest'
run: echo "echo "::remove-matcher owner=tsc::""

- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up job
uses: ./.github/actions/set-up-job

Expand All @@ -115,7 +115,7 @@ jobs:
- name: Get number of CPU cores
if: always()
id: cpu-cores
uses: SimenB/github-actions-cpu-cores@v2
uses: SimenB/github-actions-cpu-cores@97ba232459a8e02ff6121db9362b09661c875ab8 # v2

- name: 🧪 Test
run: yarn test-ci --minWorkers=1 --maxWorkers=${{ steps.cpu-cores.outputs.count }}
Expand All @@ -141,7 +141,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up job
uses: ./.github/actions/set-up-job

Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
working-directory: ${{ steps.crwa.outputs.project-path }}

- name: 🌲 Run Cypress
uses: cypress-io/github-action@v6
uses: cypress-io/github-action@df7484c5ba85def7eef30db301afa688187bc378 # v6
env:
CYPRESS_RW_PATH: ${{ steps.crwa.outputs.project-path }}
with:
Expand All @@ -181,7 +181,7 @@ jobs:
spec: |
cypress/e2e/01-tutorial/*.cy.js
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4
if: always()
with:
name: logs
Expand Down Expand Up @@ -215,7 +215,7 @@ jobs:

steps:
- name: Checkout the framework code
uses: actions/checkout@v4
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- name: Set up job
uses: ./.github/actions/set-up-job
Expand Down Expand Up @@ -305,7 +305,7 @@ jobs:

steps:
- name: Checkout the framework code
uses: actions/checkout@v4
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- name: Set up job
uses: ./.github/actions/set-up-job
Expand Down Expand Up @@ -413,7 +413,7 @@ jobs:
REDWOOD_VERBOSE_TELEMETRY: 1

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up job
uses: ./.github/actions/set-up-job

Expand Down Expand Up @@ -521,7 +521,7 @@ jobs:
REDWOOD_REDIRECT_TELEMETRY: 'http://127.0.0.1:48619' # Random port

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up job
uses: ./.github/actions/set-up-job

Expand Down Expand Up @@ -563,7 +563,7 @@ jobs:
REDWOOD_VERBOSE_TELEMETRY: 1

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up job
uses: ./.github/actions/set-up-job

Expand Down Expand Up @@ -658,7 +658,7 @@ jobs:
REDWOOD_VERBOSE_TELEMETRY: 1

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up job
uses: ./.github/actions/set-up-job

Expand Down Expand Up @@ -729,7 +729,7 @@ jobs:
REDWOOD_VERBOSE_TELEMETRY: 1

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up job
uses: ./.github/actions/set-up-job

Expand Down Expand Up @@ -806,7 +806,7 @@ jobs:
REDWOOD_DISABLE_TELEMETRY: 1

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up job
uses: ./.github/actions/set-up-job

Expand Down Expand Up @@ -847,7 +847,7 @@ jobs:
PROJECT_PATH: ${{ env.PROJECT_PATH }}

- name: ⬢ Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: 18

Expand All @@ -858,7 +858,7 @@ jobs:
PROJECT_PATH: ${{ env.PROJECT_PATH }}

- name: ⬢ Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: 21

Expand All @@ -885,7 +885,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up job
uses: ./.github/actions/set-up-job

Expand Down Expand Up @@ -917,7 +917,7 @@ jobs:
REDWOOD_VERBOSE_TELEMETRY: 1

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up job
uses: ./.github/actions/set-up-job

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
Expand All @@ -58,10 +58,10 @@ jobs:
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3
uses: github/codeql-action/autobuild@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -75,4 +75,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3
6 changes: 3 additions & 3 deletions .github/workflows/publish-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
outputs:
version: ${{ steps.get-version.outputs.value }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
# `fetch-depth`—number of commits to fetch. `0` fetches all history for all branches and tags.
# This is required because lerna uses tags to determine the version.
with:
Expand All @@ -47,7 +47,7 @@ jobs:

- name: 🏷 Get version
id: get-version
uses: sergeysova/[email protected]
uses: sergeysova/jq-action@a3f0d4ff59cc1dddf023fc0b325dd75b10deec58 # v2.3.0
with:
cmd: 'jq .version packages/core/package.json -r'

Expand All @@ -58,7 +58,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: 💬 Message Slack
uses: ./.github/actions/message_slack_publishing
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/publish-release-candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
if: github.repository == 'redwoodjs/redwood'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
# Required because lerna uses tags to determine the version.
with:
fetch-depth: 0
Expand All @@ -29,7 +29,7 @@ jobs:
run: corepack enable

- name: ⬢ Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: 20

Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
outputs:
version: ${{ steps.get-version.outputs.value }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
# `fetch-depth`—number of commits to fetch. `0` fetches all history for all branches and tags.
# This is required because lerna uses tags to determine the version.
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:

- name: 🏷 Get version
id: get-version
uses: sergeysova/[email protected]
uses: sergeysova/jq-action@a3f0d4ff59cc1dddf023fc0b325dd75b10deec58 # v2.3.0
with:
cmd: 'jq .version packages/core/package.json -r'

Expand All @@ -103,7 +103,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: 💬 Message Slack
uses: ./.github/actions/message_slack_publishing
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/require-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- name: ⬢ Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: 20

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/require-release-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
issues: read
pull-requests: read
steps:
- uses: mheap/github-action-required-labels@v5
- uses: mheap/github-action-required-labels@5847eef68201219cf0a4643ea7be61e77837bbce # v5
with:
mode: exactly
count: 1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: 'Upload to code-scanning'
uses: github/codeql-action/upload-sarif@v3
uses: github/codeql-action/upload-sarif@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3
with:
sarif_file: results.sarif

0 comments on commit 14244d9

Please sign in to comment.