mirror of
https://github.com/taiki-e/install-action.git
synced 2025-12-27 01:54:13 -05:00
53 lines
1.7 KiB
YAML
53 lines
1.7 KiB
YAML
name: Install development tools
|
|
description: GitHub Action for installing development tools
|
|
|
|
inputs:
|
|
tool:
|
|
description: Tools to install (comma-separated list)
|
|
required: false
|
|
default: cargo-sort
|
|
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:
|
|
- 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
|
|
fi
|
|
printf '::endgroup::\n'
|
|
else
|
|
printf '::error::install-action requires bash\n'
|
|
exit 1
|
|
fi
|
|
fi
|
|
shell: sh
|
|
if: runner.os == 'Linux'
|
|
- run: bash --noprofile --norc "${GITHUB_ACTION_PATH:?}/main.sh"
|
|
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 }})
|