TODO:

```
/__w/install-action/install-action/.//main.sh: line 81: syntax error: unexpected "(" (expecting "}")
```
This commit is contained in:
Taiki Endo
2026-02-14 19:24:16 +09:00
parent 04da82019b
commit eab2c9a639
5 changed files with 62 additions and 56 deletions

View File

@@ -21,32 +21,32 @@ inputs:
runs:
using: composite
steps:
- run: |
- name: Prepare
id: prepare
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 install-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
if command -v busybox >/dev/null; then
if test -n "${GITHUB_OUTPUT:-}"; then
printf 'shell=busybox sh -e {0}\n' >>"${GITHUB_OUTPUT}"
exit
fi
printf '::endgroup::\n'
else
printf '::error::install-action requires bash\n'
exit 1
fi
printf '::error::install-action requires bash or busybox\n'
exit 1
fi
shell: sh
if: runner.os == 'Linux'
- run: bash --noprofile --norc "${GITHUB_ACTION_PATH:?}/main.sh"
shell: bash
- run: |
case "${CURRENT_SHELL}" in
busybox*) busybox sh "${GITHUB_ACTION_PATH:?}/main.sh" ;;
*) bash --noprofile --norc "${GITHUB_ACTION_PATH:?}/main.sh" ;;
esac
shell: ${{ steps.prepare.outputs.shell || 'bash' }}
env:
INPUT_TOOL: ${{ inputs.tool }}
INPUT_CHECKSUM: ${{ inputs.checksum }}
INPUT_FALLBACK: ${{ inputs.fallback }}
DEFAULT_GITHUB_TOKEN: ${{ github.token }}
ACTION_USER_AGENT: ${{ github.action_repository }} (${{ github.action_ref }})
CURRENT_SHELL: ${{ steps.prepare.outputs.shell }}