-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (43 loc) · 1.7 KB
/
Copy pathwfctl-validate.yml
File metadata and controls
48 lines (43 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# .github/workflows/wfctl-validate.yml
name: wfctl strict contracts
on:
pull_request:
push:
branches: [main, master]
jobs:
wfctl-strict-contracts:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Check plugin.json and plugin.contracts.json exist
run: |
if [ ! -f plugin.json ]; then
echo "::error::plugin.json is missing — add a plugin manifest to enable strict contract validation"
exit 1
fi
if [ ! -f plugin.contracts.json ]; then
echo "::error::plugin.contracts.json is missing — add a contracts file to pass strict contract validation"
exit 1
fi
- name: Install wfctl v0.74.6
env:
GH_TOKEN: ${{ secrets.RELEASES_TOKEN || github.token }}
WFCTL_VERSION: v0.74.6
run: |
set -euo pipefail
runner_arch=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
asset="wfctl-linux-${runner_arch}"
download_dir="$(mktemp -d)"
gh release download "${WFCTL_VERSION}" \
--repo GoCodeAlone/workflow \
--pattern "${asset}" \
--pattern checksums.txt \
--dir "${download_dir}"
(cd "${download_dir}" && grep " ${asset}$" checksums.txt | sha256sum -c -)
mkdir -p "${RUNNER_TEMP}/wfctl-bin"
install -m 0755 "${download_dir}/${asset}" "${RUNNER_TEMP}/wfctl-bin/wfctl"
echo "${RUNNER_TEMP}/wfctl-bin" >> "$GITHUB_PATH"
- name: Validate strict plugin contracts
run: wfctl plugin validate --file plugin.json --strict-contracts