mirror of
https://github.com/taiki-e/install-action.git
synced 2026-05-08 05:40:31 +00:00
dev
TODO:
```
/__w/install-action/install-action/.//main.sh: line 81: syntax error: unexpected "(" (expecting "}")
```
This commit is contained in:
32
action.yml
32
action.yml
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user