mirror of
https://github.com/taiki-e/install-action.git
synced 2026-04-23 07:40:40 +00:00
tools: Update tidy.sh
This commit is contained in:
@@ -894,10 +894,19 @@ EOF
|
|||||||
for job in $(jq -c '.jobs | to_entries[] | select(.value.steps)' <<<"${workflow}"); do
|
for job in $(jq -c '.jobs | to_entries[] | select(.value.steps)' <<<"${workflow}"); do
|
||||||
name=$(jq -r '.key' <<<"${job}")
|
name=$(jq -r '.key' <<<"${job}")
|
||||||
job=$(jq -r '.value' <<<"${job}")
|
job=$(jq -r '.value' <<<"${job}")
|
||||||
|
eval "$(jq -r '@sh "RUNS_ON=\(."runs-on") TIMEOUT_MINUTES=\(."timeout-minutes") JOB_DEFAULT_SHELL=\(.defaults.run.shell)"' <<<"${job}")"
|
||||||
|
if [[ "${TIMEOUT_MINUTES}" == 'null' ]]; then
|
||||||
|
error ".jobs.${name}.timeout-minutes must be set"
|
||||||
|
fi
|
||||||
|
if [[ "${RUNS_ON}" == 'ubuntu-slim' ]]; then
|
||||||
|
case "${TIMEOUT_MINUTES}" in
|
||||||
|
? | 1[0-5]) ;;
|
||||||
|
*) error ".jobs.${name}.timeout-minutes must be <= 15 because max execution time of ubuntu-slim runner is 15 minutes" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
n=0
|
n=0
|
||||||
job_default_shell=$(jq -r '.defaults.run.shell' <<<"${job}")
|
if [[ "${JOB_DEFAULT_SHELL}" == 'null' ]]; then
|
||||||
if [[ "${job_default_shell}" == 'null' ]]; then
|
JOB_DEFAULT_SHELL="${default_shell}"
|
||||||
job_default_shell="${default_shell}"
|
|
||||||
fi
|
fi
|
||||||
for step in $(jq -c '.steps[]' <<<"${job}"); do
|
for step in $(jq -c '.steps[]' <<<"${job}"); do
|
||||||
prepare=''
|
prepare=''
|
||||||
@@ -908,7 +917,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
if [[ "${shell}" == 'null' ]]; then
|
if [[ "${shell}" == 'null' ]]; then
|
||||||
if [[ -z "${prepare}" ]]; then
|
if [[ -z "${prepare}" ]]; then
|
||||||
shell="${job_default_shell}"
|
shell="${JOB_DEFAULT_SHELL}"
|
||||||
elif grep -Eq '^ *chsh +-s +[^ ]+/bash' <<<"${prepare}"; then
|
elif grep -Eq '^ *chsh +-s +[^ ]+/bash' <<<"${prepare}"; then
|
||||||
shell='bash'
|
shell='bash'
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user