fix shell

This commit is contained in:
Lain Iwakura 2025-06-20 22:30:28 +03:00
commit 65365c89f1
No known key found for this signature in database
GPG Key ID: C7C18257F2ADC6F8
2 changed files with 78 additions and 0 deletions

54
action.yml Normal file
View File

@ -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

24
example.yml Normal file
View File

@ -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