mirror of
https://github.com/taiki-e/install-action.git
synced 2026-04-27 01:20:28 +00:00
TODO:
```
/__w/install-action/install-action/.//main.sh: line 81: syntax error: unexpected "(" (expecting "}")
```
53 lines
1.8 KiB
YAML
53 lines
1.8 KiB
YAML
name: Install development tools
|
|
description: GitHub Action for installing development tools
|
|
|
|
inputs:
|
|
tool:
|
|
description: Tools to install (whitespace or comma separated list)
|
|
required: true
|
|
# default: #publish:tool
|
|
checksum:
|
|
description: Whether to enable checksums
|
|
required: false
|
|
default: 'true'
|
|
fallback:
|
|
description: Whether to use fallback (none, cargo-binstall, cargo-install)
|
|
required: false
|
|
default: 'cargo-binstall'
|
|
|
|
# Note:
|
|
# - inputs.* should be manually mapped to INPUT_* due to https://github.com/actions/runner/issues/665
|
|
# - Use GITHUB_*/RUNNER_* instead of github.*/runner.* due to https://github.com/actions/runner/issues/2185
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Prepare
|
|
id: prepare
|
|
run: |
|
|
set -eu
|
|
if ! command -v bash >/dev/null; then
|
|
if command -v busybox >/dev/null; then
|
|
if test -n "${GITHUB_OUTPUT:-}"; then
|
|
printf 'shell=busybox sh -e {0}\n' >>"${GITHUB_OUTPUT}"
|
|
exit
|
|
fi
|
|
fi
|
|
printf '::error::install-action requires bash or busybox\n'
|
|
exit 1
|
|
fi
|
|
shell: sh
|
|
if: runner.os == 'Linux'
|
|
- 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 }}
|