-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
29 lines (28 loc) · 1.07 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
name: Checks for system dependency for given Ruby gem and installs if needed
inputs:
gem-name:
required: true
description: "Name of the gem that requires system dependency "
required-library:
required: true
description: "Name of the library to be installed (use a space-delimited string for multiple libraries)"
package-manager:
required: false
description: "Name of package manager"
default: "apt-get"
runs:
using: composite
steps:
- name: Check for gem dependency
shell: bash
id: dependency
run: |
echo "Checking if ${{ inputs.gem-name }} is needed"
echo "COUNT=$(grep -s ${{ inputs.gem-name }} Gemfile* *.gemspec | wc -l)" >> $GITHUB_OUTPUT
- name: Install system dependency for gem
if: ${{ steps.dependency.outputs.COUNT > 0 }}
shell: bash
run: |
echo "${{ inputs.gem-name }} is needed, installing ${{ inputs.required-library }} system dependency"
sudo ${{ inputs.package-manager }} update
sudo ${{ inputs.package-manager }} -y install ${{ inputs.required-library }}