mirror of
https://github.com/taiki-e/install-action.git
synced 2026-04-27 01:20:28 +00:00
tools: Update tidy.sh
This commit is contained in:
@@ -27,15 +27,14 @@ fi
|
|||||||
if [[ -n "${TIDY_DEV:-}" ]]; then
|
if [[ -n "${TIDY_DEV:-}" ]]; then
|
||||||
image="ghcr.io/taiki-e/tidy:latest"
|
image="ghcr.io/taiki-e/tidy:latest"
|
||||||
else
|
else
|
||||||
image="ghcr.io/taiki-e/tidy@sha256:4552cbce9426e102f9650cd9f8381e836fc8fda081dcbddcc7f31b15d48d1654"
|
image="ghcr.io/taiki-e/tidy@sha256:bce85a4321f80c09f2b68420e9149bcf7c085130ab1e1fca54443f76833cd184"
|
||||||
fi
|
fi
|
||||||
user="$(id -u):$(id -g)"
|
user="$(id -u):$(id -g)"
|
||||||
workdir=$(pwd)
|
workdir=$(pwd)
|
||||||
tmp=$(mktemp -d)
|
tmp=$(mktemp -d)
|
||||||
trap -- 'rm -rf -- "${tmp:?}"' EXIT
|
trap -- 'rm -rf -- "${tmp:?}"' EXIT
|
||||||
mkdir -p -- "${tmp}/zizmor"
|
mkdir -p -- "${tmp}"/{pwsh-cache,pwsh-local,zizmor-cache,dummy-dir,tmp}
|
||||||
touch -- "${tmp}/dummy"
|
touch -- "${tmp}"/dummy
|
||||||
mkdir -- "${tmp}/dummy-dir"
|
|
||||||
code=0
|
code=0
|
||||||
color=''
|
color=''
|
||||||
if [[ -t 1 ]] || [[ -n "${GITHUB_ACTIONS:-}" ]]; then
|
if [[ -t 1 ]] || [[ -n "${GITHUB_ACTIONS:-}" ]]; then
|
||||||
@@ -84,22 +83,25 @@ docker_run() {
|
|||||||
set +e
|
set +e
|
||||||
docker_run \
|
docker_run \
|
||||||
--mount "type=bind,source=${workdir},target=${workdir}" --workdir "${workdir}" \
|
--mount "type=bind,source=${workdir},target=${workdir}" --workdir "${workdir}" \
|
||||||
|
--mount "type=bind,source=${tmp}/tmp,target=/tmp/tidy" \
|
||||||
|
--mount "type=bind,source=${tmp}/pwsh-cache,target=/.cache/powershell" \
|
||||||
|
--mount "type=bind,source=${tmp}/pwsh-local,target=/.local/share/powershell" \
|
||||||
--network=none \
|
--network=none \
|
||||||
"${image}" \
|
"${image}" \
|
||||||
/checks/offline.sh
|
/checks/offline.sh
|
||||||
# Some good audits requires access to GitHub API.
|
# Some good audits requires access to GitHub API.
|
||||||
docker_run \
|
docker_run \
|
||||||
--mount "type=bind,source=${workdir},target=${workdir},readonly" --workdir "${workdir}" \
|
--mount "type=bind,source=${workdir},target=${workdir},readonly" --workdir "${workdir}" \
|
||||||
--mount "type=bind,source=${tmp}/zizmor,target=/.cache/zizmor" \
|
--mount "type=bind,source=${tmp}/zizmor-cache,target=/.cache/zizmor" \
|
||||||
--env GH_TOKEN --env GITHUB_TOKEN --env ZIZMOR_GITHUB_TOKEN \
|
--env GH_TOKEN --env GITHUB_TOKEN --env ZIZMOR_GITHUB_TOKEN \
|
||||||
"${image}" \
|
"${image}" \
|
||||||
/checks/zizmor.sh
|
/checks/zizmor.sh
|
||||||
# We use remote dictionary.
|
# We use remote dictionary.
|
||||||
docker_run \
|
docker_run \
|
||||||
--mount "type=bind,source=${workdir},target=${workdir},readonly" --workdir "${workdir}" \
|
--mount "type=bind,source=${workdir},target=${workdir},readonly" --workdir "${workdir}" \
|
||||||
--mount "type=bind,source=${workdir}/.cspell.json,target=${workdir}/.cspell.json" \
|
|
||||||
--mount "type=bind,source=${workdir}/.github/.cspell/project-dictionary.txt,target=${workdir}/.github/.cspell/project-dictionary.txt" \
|
--mount "type=bind,source=${workdir}/.github/.cspell/project-dictionary.txt,target=${workdir}/.github/.cspell/project-dictionary.txt" \
|
||||||
--mount "type=bind,source=${workdir}/.github/.cspell/rust-dependencies.txt,target=${workdir}/.github/.cspell/rust-dependencies.txt" \
|
--mount "type=bind,source=${workdir}/.github/.cspell/rust-dependencies.txt,target=${workdir}/.github/.cspell/rust-dependencies.txt" \
|
||||||
|
--mount "type=bind,source=${tmp}/tmp,target=/tmp/tidy" \
|
||||||
"${image}" \
|
"${image}" \
|
||||||
/checks/cspell.sh
|
/checks/cspell.sh
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user