Skip to content

Commit 7c8485f

Browse files
committed
Update script and CI config
1 parent fc2a2b3 commit 7c8485f

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134
if: startsWith(matrix.os, 'windows')
135135
- name: Test cmd
136136
run: just --version & shfmt --version & protoc --version
137-
shell: cmd
137+
shell: cmd # zizmor: ignore[misfeature] used for compatibility testing
138138
if: startsWith(matrix.os, 'windows')
139139
# We use the version output to check the version of cargo-binstall, but they
140140
# several times change the version output format in the past so we need to

.github/zizmor.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,3 @@ rules:
1010
policies:
1111
taiki-e/*: any
1212
'*': ref-pin
13-
misfeature:
14-
ignore:
15-
# We use `shell: cmd` to test compatibility.
16-
- ci.yml

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
target
22
Cargo.lock
3+
mutants.out*
34
tmp
45

56
# For platform and editor specific settings, it is recommended to add to

tools/tidy.sh

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -909,8 +909,21 @@ EOF
909909
JOB_DEFAULT_SHELL="${default_shell}"
910910
fi
911911
for step in $(jq -c '.steps[]' <<<"${job}"); do
912+
uses=''
913+
# https://github.com/vmactions: prepare, run
914+
# https://github.com/cross-platform-actions/action: run, shell
915+
# https://github.com/uraimo/run-on-arch-action: setup, install, run, shell
912916
prepare=''
913-
eval "$(jq -r 'if .run then @sh "RUN=\(.run) shell=\(.shell)" else @sh "RUN=\(.with.run) prepare=\(.with.prepare) shell=\(.with.shell)" end' <<<"${step}")"
917+
setup=''
918+
install=''
919+
eval "$(jq -r 'if .run then @sh "RUN=\(.run) shell=\(.shell)" else @sh "uses=\(.uses) FALLBACK=\(.with.fallback) RUN=\(.with.run) prepare=\(.with.prepare) setup=\(.with.setup) install=\(.with.install) shell=\(.with.shell)" end' <<<"${step}")"
920+
if [[ "${uses}" == */install-action@* ]]; then
921+
if [[ "${FALLBACK}" != 'none' ]]; then
922+
error "'fallback: none' must be set for install-action (${name}.steps[${n}])"
923+
fi
924+
_=$((n++))
925+
continue
926+
fi
914927
if [[ "${RUN}" == 'null' ]]; then
915928
_=$((n++))
916929
continue
@@ -924,8 +937,14 @@ EOF
924937
shell='sh'
925938
fi
926939
fi
927-
shellcheck_for_gha "${RUN}" "${shell}" "${workflow_path} ${name}.steps[${n}].run"
928-
shellcheck_for_gha "${prepare:-null}" 'sh' "${workflow_path} ${name}.steps[${n}].run"
940+
if [[ -z "${uses}" ]]; then
941+
shellcheck_for_gha "${RUN}" "${shell}" "${workflow_path} ${name}.steps[${n}].run"
942+
else
943+
shellcheck_for_gha "${RUN}" "${shell}" "${workflow_path} ${name}.steps[${n}].with.run"
944+
fi
945+
shellcheck_for_gha "${prepare:-null}" 'sh' "${workflow_path} ${name}.steps[${n}].with.prepare"
946+
shellcheck_for_gha "${setup:-null}" "${shell}" "${workflow_path} ${name}.steps[${n}].with.setup"
947+
shellcheck_for_gha "${install:-null}" "${shell}" "${workflow_path} ${name}.steps[${n}].with.install"
929948
_=$((n++))
930949
done
931950
done

0 commit comments

Comments
 (0)