mirror of
https://github.com/taiki-e/install-action.git
synced 2026-05-15 08:40:53 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dabb9c1ee5 | ||
|
|
67d50f4c7a | ||
|
|
ccb87e050c | ||
|
|
598eb1aa13 | ||
|
|
fcdd50a1bc |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,6 @@
|
|||||||
target
|
target
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
|
.venv
|
||||||
tmp
|
tmp
|
||||||
|
|
||||||
# For platform and editor specific settings, it is recommended to add to
|
# For platform and editor specific settings, it is recommended to add to
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [2.28.1] - 2024-03-04
|
||||||
|
|
||||||
|
- Update `wasm-bindgen@latest` to 0.2.92.
|
||||||
|
|
||||||
## [2.28.0] - 2024-03-02
|
## [2.28.0] - 2024-03-02
|
||||||
|
|
||||||
- Support `wasm-bindgen`. ([#383](https://github.com/taiki-e/install-action/pull/383), thanks @Ekleog)
|
- Support `wasm-bindgen`. ([#383](https://github.com/taiki-e/install-action/pull/383), thanks @Ekleog)
|
||||||
@@ -1837,7 +1841,8 @@ Note: This release is considered a breaking change because installing on version
|
|||||||
|
|
||||||
Initial release
|
Initial release
|
||||||
|
|
||||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.28.0...HEAD
|
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.28.1...HEAD
|
||||||
|
[2.28.1]: https://github.com/taiki-e/install-action/compare/v2.28.0...v2.28.1
|
||||||
[2.28.0]: https://github.com/taiki-e/install-action/compare/v2.27.15...v2.28.0
|
[2.28.0]: https://github.com/taiki-e/install-action/compare/v2.27.15...v2.28.0
|
||||||
[2.27.15]: https://github.com/taiki-e/install-action/compare/v2.27.14...v2.27.15
|
[2.27.15]: https://github.com/taiki-e/install-action/compare/v2.27.14...v2.27.15
|
||||||
[2.27.14]: https://github.com/taiki-e/install-action/compare/v2.27.13...v2.27.14
|
[2.27.14]: https://github.com/taiki-e/install-action/compare/v2.27.13...v2.27.14
|
||||||
|
|||||||
21
manifests/wasm-bindgen.json
generated
21
manifests/wasm-bindgen.json
generated
@@ -43,10 +43,27 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"latest": {
|
"latest": {
|
||||||
"version": "0.2.91"
|
"version": "0.2.92"
|
||||||
},
|
},
|
||||||
"0.2": {
|
"0.2": {
|
||||||
"version": "0.2.91"
|
"version": "0.2.92"
|
||||||
|
},
|
||||||
|
"0.2.92": {
|
||||||
|
"x86_64_linux_musl": {
|
||||||
|
"checksum": "c6e43a3bf0be5231e0b72ea702f73b3f4f47c309037e8a332c5c2e41800ca934"
|
||||||
|
},
|
||||||
|
"x86_64_macos": {
|
||||||
|
"checksum": "1091b40f5e2cc67d10deb3b1260a92b97cef8851f2588708c2d4b6bef9444880"
|
||||||
|
},
|
||||||
|
"x86_64_windows": {
|
||||||
|
"checksum": "a23d556b35bc4d17222e324b205a1b66b1cdad630f62a1190ba6c42cf5ed2af7"
|
||||||
|
},
|
||||||
|
"aarch64_linux_gnu": {
|
||||||
|
"checksum": "ae6070b6f6a86160f9be02ee9c913820814825f6e8aff45b155a129a36acc0cb"
|
||||||
|
},
|
||||||
|
"aarch64_macos": {
|
||||||
|
"checksum": "9ac857faddd4368e5ad3f41b74bbc4c2d32c3726d008bd5760fc52c7c6843e48"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"0.2.91": {
|
"0.2.91": {
|
||||||
"x86_64_linux_musl": {
|
"x86_64_linux_musl": {
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ trap 's=$?; echo >&2 "$0: error on line "${LINENO}": ${BASH_COMMAND}"; exit ${s}
|
|||||||
# - shfmt
|
# - shfmt
|
||||||
# - shellcheck
|
# - shellcheck
|
||||||
# - npm
|
# - npm
|
||||||
# - jq and yq
|
# - jq
|
||||||
|
# - python
|
||||||
# - rustup (if Rust code exists)
|
# - rustup (if Rust code exists)
|
||||||
# - clang-format (if C/C++ code exists)
|
# - clang-format (if C/C++ code exists)
|
||||||
#
|
#
|
||||||
@@ -53,6 +54,11 @@ error() {
|
|||||||
fi
|
fi
|
||||||
should_fail=1
|
should_fail=1
|
||||||
}
|
}
|
||||||
|
venv() {
|
||||||
|
local bin="$1"
|
||||||
|
shift
|
||||||
|
"${venv_bin}/${bin}${exe}" "$@"
|
||||||
|
}
|
||||||
|
|
||||||
if [[ $# -gt 0 ]]; then
|
if [[ $# -gt 0 ]]; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
@@ -204,32 +210,54 @@ if [[ -n "$(git ls-files '*.yml' '*.js' '*.json')" ]]; then
|
|||||||
# Check GitHub workflows.
|
# Check GitHub workflows.
|
||||||
if [[ -d .github/workflows ]]; then
|
if [[ -d .github/workflows ]]; then
|
||||||
info "checking GitHub workflows"
|
info "checking GitHub workflows"
|
||||||
if type -P jq &>/dev/null && type -P yq &>/dev/null; then
|
if type -P jq &>/dev/null; then
|
||||||
for workflow in .github/workflows/*.yml; do
|
if type -P python3 &>/dev/null || type -P python &>/dev/null; then
|
||||||
# The top-level permissions must be weak as they are referenced by all jobs.
|
py_suffix=''
|
||||||
permissions=$(yq -c '.permissions' "${workflow}")
|
if type -P python3 &>/dev/null; then
|
||||||
case "${permissions}" in
|
py_suffix='3'
|
||||||
'{"contents":"read"}' | '{"contents":"none"}') ;;
|
|
||||||
null) error "${workflow}: top level permissions not found; it must be 'contents: read' or weaker permissions" ;;
|
|
||||||
*) error "${workflow}: only 'contents: read' and weaker permissions are allowed at top level; if you want to use stronger permissions, please set job-level permissions" ;;
|
|
||||||
esac
|
|
||||||
# Make sure the 'needs' section is not out of date.
|
|
||||||
if grep -q '# tidy:needs' "${workflow}" && ! grep -Eq '# *needs: \[' "${workflow}"; then
|
|
||||||
# shellcheck disable=SC2207
|
|
||||||
jobs_actual=($(yq '.jobs' "${workflow}" | jq -r 'keys_unsorted[]'))
|
|
||||||
unset 'jobs_actual[${#jobs_actual[@]}-1]'
|
|
||||||
# shellcheck disable=SC2207
|
|
||||||
jobs_expected=($(yq -r '.jobs."ci-success".needs[]' "${workflow}"))
|
|
||||||
if [[ "${jobs_actual[*]}" != "${jobs_expected[*]+"${jobs_expected[*]}"}" ]]; then
|
|
||||||
printf -v jobs '%s, ' "${jobs_actual[@]}"
|
|
||||||
sed -i "s/needs: \[.*\] # tidy:needs/needs: [${jobs%, }] # tidy:needs/" "${workflow}"
|
|
||||||
check_diff "${workflow}"
|
|
||||||
error "${workflow}: please update 'needs' section in 'ci-success' job"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
done
|
exe=''
|
||||||
|
venv_bin='.venv/bin'
|
||||||
|
case "$(uname -s)" in
|
||||||
|
MINGW* | MSYS* | CYGWIN* | Windows_NT)
|
||||||
|
exe='.exe'
|
||||||
|
venv_bin='.venv/Scripts'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
if [[ ! -d .venv ]]; then
|
||||||
|
"python${py_suffix}" -m venv .venv
|
||||||
|
fi
|
||||||
|
if [[ ! -e "${venv_bin}/yq${exe}" ]]; then
|
||||||
|
venv "pip${py_suffix}" install yq
|
||||||
|
fi
|
||||||
|
for workflow in .github/workflows/*.yml; do
|
||||||
|
# The top-level permissions must be weak as they are referenced by all jobs.
|
||||||
|
permissions=$(venv yq -c '.permissions' "${workflow}")
|
||||||
|
case "${permissions}" in
|
||||||
|
'{"contents":"read"}' | '{"contents":"none"}') ;;
|
||||||
|
null) error "${workflow}: top level permissions not found; it must be 'contents: read' or weaker permissions" ;;
|
||||||
|
*) error "${workflow}: only 'contents: read' and weaker permissions are allowed at top level; if you want to use stronger permissions, please set job-level permissions" ;;
|
||||||
|
esac
|
||||||
|
# Make sure the 'needs' section is not out of date.
|
||||||
|
if grep -q '# tidy:needs' "${workflow}" && ! grep -Eq '# *needs: \[' "${workflow}"; then
|
||||||
|
# shellcheck disable=SC2207
|
||||||
|
jobs_actual=($(venv yq '.jobs' "${workflow}" | jq -r 'keys_unsorted[]'))
|
||||||
|
unset 'jobs_actual[${#jobs_actual[@]}-1]'
|
||||||
|
# shellcheck disable=SC2207
|
||||||
|
jobs_expected=($(venv yq -r '.jobs."ci-success".needs[]' "${workflow}"))
|
||||||
|
if [[ "${jobs_actual[*]}" != "${jobs_expected[*]+"${jobs_expected[*]}"}" ]]; then
|
||||||
|
printf -v jobs '%s, ' "${jobs_actual[@]}"
|
||||||
|
sed -i "s/needs: \[.*\] # tidy:needs/needs: [${jobs%, }] # tidy:needs/" "${workflow}"
|
||||||
|
check_diff "${workflow}"
|
||||||
|
error "${workflow}: please update 'needs' section in 'ci-success' job"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
warn "'python3' is not installed; skipped GitHub workflow check"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
warn "'jq' or 'yq' is not installed; skipped GitHub workflow check"
|
warn "'jq' is not installed; skipped GitHub workflow check"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user