commit 65365c89f14ce0262b04c1cb472a21d23df4fded Author: Lain Iwakura Date: Fri Jun 20 22:30:28 2025 +0300 fix shell diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..fd76161 --- /dev/null +++ b/action.yml @@ -0,0 +1,54 @@ +name: 'Fix Shell Alpine' +description: 'Fix shell issues on Alpine runners by installing bash and nodejs' +branding: + icon: 'terminal' + color: 'blue' + +inputs: + install-bash: + description: 'Install bash' + required: false + default: 'true' + install-nodejs: + description: 'Install nodejs' + required: false + default: 'true' + extra-packages: + description: 'Additional packages to install' + required: false + default: '' + +runs: + using: 'composite' + steps: + - name: Update package index + if: runner.os == 'Linux' + shell: sh + run: | + if command -v apk >/dev/null 2>&1; then + apk update + fi + + - name: Install bash + if: inputs.install-bash == 'true' && runner.os == 'Linux' + shell: sh + run: | + if command -v apk >/dev/null 2>&1; then + apk add --no-cache bash + fi + + - name: Install nodejs + if: inputs.install-nodejs == 'true' && runner.os == 'Linux' + shell: sh + run: | + if command -v apk >/dev/null 2>&1; then + apk add --no-cache nodejs npm + fi + + - name: Install extra packages + if: inputs.extra-packages != '' && runner.os == 'Linux' + shell: sh + run: | + if command -v apk >/dev/null 2>&1; then + apk add --no-cache ${{ inputs.extra-packages }} + fi \ No newline at end of file diff --git a/example.yml b/example.yml new file mode 100644 index 0000000..ee059df --- /dev/null +++ b/example.yml @@ -0,0 +1,24 @@ +name: Test Alpine Fix + +on: [push, pull_request] + +jobs: + test-alpine: + runs-on: alpine-latest + steps: + - uses: actions/checkout@v3 + + - name: Fix Alpine Shell + uses: lain/fixsh-alpine@main + with: + install-bash: 'true' + install-nodejs: 'true' + extra-packages: 'git curl' + + - name: Test bash + shell: bash + run: echo "Bash works!" + + - name: Test nodejs + shell: sh + run: node --version \ No newline at end of file