-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
action.yml
47 lines (46 loc) · 1.79 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: checkout-action
description: GitHub Action for checking out a repository. (Simplified actions/checkout alternative that does not depend on Node.js.)
# 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 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'
elif grep -Eq '^ID_LIKE=.*openwrt' /etc/os-release; then
printf '::group::Install packages required for checkout-action (bash)\n'
# NB: sync with opkg_install in main.sh
if command -v sudo >/dev/null; then
sudo mkdir -p /var/lock
sudo opkg update
sudo opkg install bash
else
mkdir -p /var/lock
opkg update
opkg install 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
if: runner.os != 'Windows'
- run: bash --noprofile --norc "${GITHUB_ACTION_PATH:?}/main.sh"
shell: bash
if: runner.os == 'Windows'