Improve platform support

This commit is contained in:
Taiki Endo
2024-07-16 00:11:38 +09:00
parent 996330bfc2
commit 3a2f9ffb94
8 changed files with 134 additions and 42 deletions

View File

@@ -21,8 +21,27 @@ inputs:
runs:
using: composite
steps:
- run: bash --noprofile --norc "${GITHUB_ACTION_PATH:?}/main.sh"
shell: bash
- run: |
set -eu
if ! command -v bash >/dev/null; then
if grep -Eq '^ID=alpine' /etc/os-release; then
printf '::group::Install packages required for checkout-action (bash)\n'
# NB: sync with apk_install in main.sh
if command -v sudo >/dev/null; then
sudo apk --no-cache add bash
elif command -v doas >/dev/null; then
doas apk --no-cache add bash
else
apk --no-cache add bash
fi
printf '::endgroup::\n'
else
printf '::error::checkout-action requires bash\n'
exit 1
fi
fi
bash --noprofile --norc "${GITHUB_ACTION_PATH:?}/main.sh"
shell: sh
env:
INPUT_TOOL: ${{ inputs.tool }}
INPUT_CHECKSUM: ${{ inputs.checksum }}