Skip to content

Commit 52aafd2

Browse files
rohankmr414claude
andauthored
ci: pin GitHub Actions to commit SHAs (#112)
Replace mutable tag references with immutable commit SHAs across workflow files. Original tags are preserved as inline comments. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 945e745 commit 52aafd2

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

.github/workflows/deploy-stage.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,25 @@ jobs:
2020
packages: write
2121
steps:
2222
- name: Checkout repository
23-
uses: actions/checkout@v4
23+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
2424
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
2525
- name: Log in to the Container registry
26-
uses: docker/login-action@v3
26+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
2727
with:
2828
registry: ${{ env.REGISTRY }}
2929
username: ${{ github.actor }}
3030
password: ${{ secrets.GITHUB_TOKEN }}
3131
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
3232
- name: Extract metadata (tags, labels) for Docker
3333
id: meta
34-
uses: docker/metadata-action@v5
34+
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5
3535
with:
3636
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3737
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
3838
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
3939
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
4040
- name: Build and push Docker image
41-
uses: docker/build-push-action@v5
41+
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
4242
with:
4343
context: .
4444
push: true
@@ -73,10 +73,10 @@ jobs:
7373
extension: .exe
7474
runs-on: ${{ matrix.runner }}
7575
steps:
76-
- uses: actions/checkout@v4
76+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
7777

7878
- name: Set up Go environment
79-
uses: actions/setup-go@v5
79+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
8080
with:
8181
go-version: '1.22'
8282

@@ -86,7 +86,7 @@ jobs:
8686
echo "Building binary file for target: ${{ matrix.goos }}${{ matrix.goarch }}"
8787
env GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} CGO_ENABLED=0 go build -o ./release/ndc-elasticsearch-cli-${{ matrix.target }}${{ matrix.extension }}
8888
89-
- uses: actions/upload-artifact@v4
89+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
9090
with:
9191
name: ndc-elasticsearch-cli-${{ matrix.target }}${{ matrix.extension }}
9292
path: release/
@@ -102,9 +102,9 @@ jobs:
102102
runs-on: ubuntu-latest
103103
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
104104
steps:
105-
- uses: actions/checkout@v4
105+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
106106

107-
- uses: actions/download-artifact@v4
107+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
108108
with:
109109
path: release/artifacts
110110
merge-multiple: true
@@ -125,7 +125,7 @@ jobs:
125125
mkdir -p "${ROOT}/release/"
126126
cat "${ROOT}/ci/templates/manifest.yaml" | envsubst > "${ROOT}/release/manifest.yaml"
127127
128-
- uses: actions/upload-artifact@v4
128+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
129129
with:
130130
name: manifest.yaml
131131
path: release/manifest.yaml
@@ -143,7 +143,7 @@ jobs:
143143
cat "${ROOT}/ci/templates/connector-metadata.yaml" | envsubst '$DOCKER_IMAGE,$CLI_VERSION' > "${ROOT}/release/connector-definition/.hasura-connector/connector-metadata.yaml"
144144
tar -czvf "${ROOT}/release/artifacts/connector-definition.tgz" --directory "${ROOT}/release/connector-definition/" .
145145
146-
- uses: actions/upload-artifact@v4
146+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
147147
with:
148148
name: connector-definition.tgz
149149
path: ./release/artifacts/connector-definition.tgz
@@ -155,14 +155,14 @@ jobs:
155155
echo "tagged_version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
156156
shell: bash
157157

158-
- uses: mindsers/changelog-reader-action@v2
158+
- uses: mindsers/changelog-reader-action@97a0b06549019bb99a571f1664272db18031acff # v2
159159
id: changelog-reader
160160
with:
161161
version: ${{ steps.get-version.outputs.tagged_version }}
162162
path: ./CHANGELOG.md
163163

164164
- name: create a draft release
165-
uses: ncipollo/release-action@v1
165+
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1
166166
with:
167167
draft: true
168168
tag: v${{ steps.get-version.outputs.tagged_version }}

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
unit-tests:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v6
12+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
1313

1414
- name: Set up Go
15-
uses: actions/setup-go@v6
15+
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6
1616
with:
1717
go-version-file: ./go.mod
1818

0 commit comments

Comments
 (0)