fix shell
This commit is contained in:
commit
65365c89f1
54
action.yml
Normal file
54
action.yml
Normal 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
24
example.yml
Normal 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
|
Loading…
x
Reference in New Issue
Block a user