Skip to content

Commit 02e0e38

Browse files
authored
ci: modernize action pins and Go baseline (#25)
* ci: modernize workflow action pins * ci: bump Go module version
1 parent 2064d22 commit 02e0e38

4 files changed

Lines changed: 46 additions & 15 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ jobs:
1010
permissions:
1111
contents: read
1212
steps:
13-
- uses: actions/checkout@v4
14-
- uses: actions/setup-go@v5
13+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
14+
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
1515
with:
1616
go-version-file: go.mod
17+
cache: false
1718
- name: Configure git for private modules
1819
run: git config --global url."https://${{ secrets.RELEASES_TOKEN }}@github.com/".insteadOf "https://github.com/"
1920
- run: go build ./...

‎.github/workflows/release.yml‎

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,34 @@ jobs:
1010
release:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
1414
with:
1515
fetch-depth: 0
16-
- uses: actions/setup-go@v5
16+
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
1717
with:
1818
go-version-file: go.mod
19-
- uses: GoCodeAlone/setup-wfctl@v1
20-
with:
21-
version: v0.63.2
19+
cache: false
20+
- name: Install wfctl v0.74.6
21+
env:
22+
GH_TOKEN: ${{ secrets.RELEASES_TOKEN || github.token }}
23+
WFCTL_VERSION: v0.74.6
24+
run: |
25+
set -euo pipefail
26+
runner_arch=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
27+
asset="wfctl-linux-${runner_arch}"
28+
download_dir="$(mktemp -d)"
29+
gh release download "${WFCTL_VERSION}" \
30+
--repo GoCodeAlone/workflow \
31+
--pattern "${asset}" \
32+
--pattern checksums.txt \
33+
--dir "${download_dir}"
34+
(cd "${download_dir}" && grep " ${asset}$" checksums.txt | sha256sum -c -)
35+
mkdir -p "${RUNNER_TEMP}/wfctl-bin"
36+
install -m 0755 "${download_dir}/${asset}" "${RUNNER_TEMP}/wfctl-bin/wfctl"
37+
echo "${RUNNER_TEMP}/wfctl-bin" >> "$GITHUB_PATH"
2238
- name: Validate plugin contract for publish (pre-build)
2339
run: wfctl plugin validate-contract --for-publish --tag "${{ github.ref_name }}" .
24-
- uses: goreleaser/goreleaser-action@v7
40+
- uses: goreleaser/goreleaser-action@5daf1e915a5f0af01ddbcd89a43b8061ff4f1a89 # v7.2.2
2541
with:
2642
distribution: goreleaser
2743
version: '~> v2'
@@ -67,7 +83,7 @@ jobs:
6783
&& github.repository == 'GoCodeAlone/workflow-plugin-github'
6884
steps:
6985
- name: Trigger registry manifest sync
70-
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4
86+
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
7187
with:
7288
token: ${{ secrets.repo_dispatch_token }}
7389
repository: GoCodeAlone/workflow-registry

‎.github/workflows/wfctl-validate.yml‎

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
permissions:
1313
contents: read
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
1616

1717
- name: Check plugin.json and plugin.contracts.json exist
1818
run: |
@@ -25,10 +25,24 @@ jobs:
2525
exit 1
2626
fi
2727
28-
- uses: GoCodeAlone/setup-wfctl@bcd880980f5bbe8d192d0c20ff6279d25331f956
29-
with:
30-
version: latest
31-
token: ${{ secrets.RELEASES_TOKEN }}
28+
- name: Install wfctl v0.74.6
29+
env:
30+
GH_TOKEN: ${{ secrets.RELEASES_TOKEN || github.token }}
31+
WFCTL_VERSION: v0.74.6
32+
run: |
33+
set -euo pipefail
34+
runner_arch=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
35+
asset="wfctl-linux-${runner_arch}"
36+
download_dir="$(mktemp -d)"
37+
gh release download "${WFCTL_VERSION}" \
38+
--repo GoCodeAlone/workflow \
39+
--pattern "${asset}" \
40+
--pattern checksums.txt \
41+
--dir "${download_dir}"
42+
(cd "${download_dir}" && grep " ${asset}$" checksums.txt | sha256sum -c -)
43+
mkdir -p "${RUNNER_TEMP}/wfctl-bin"
44+
install -m 0755 "${download_dir}/${asset}" "${RUNNER_TEMP}/wfctl-bin/wfctl"
45+
echo "${RUNNER_TEMP}/wfctl-bin" >> "$GITHUB_PATH"
3246
3347
- name: Validate strict plugin contracts
3448
run: wfctl plugin validate --file plugin.json --strict-contracts

‎go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/GoCodeAlone/workflow-plugin-github
22

3-
go 1.26.0
3+
go 1.26.4
44

55
require (
66
github.com/GoCodeAlone/workflow v0.64.0

0 commit comments

Comments
 (0)