-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
60 lines (59 loc) · 1.84 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
48
49
50
51
52
53
54
55
56
57
58
59
60
name: 'License Check'
description: 'Ensure license compliance'
inputs:
permitted-licenses:
description: 'A comma separated list of licenses that are permitted'
required: false
approved-dependencies:
description: 'A comma separated list of dependencies that are approved'
required: false
base-path:
description: 'The base path with the code to review'
required: true
default: ${{ github.workspace }}
runs:
using: "composite"
steps:
- name: Setup Ruby # for license_finder package
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
- name: 'Install license-finder'
run: |
echo "Installing license_finder"
sudo gem install license_finder
shell: bash
- name: 'Add permitted licenses'
working-directory: ${{ inputs.base-path }}
run: |
echo "Configuring permitted licenses"
licenses="${{ inputs.permitted-licenses }}"
for i in ${licenses//,/ }
do
license_finder permitted_licenses add $i
done
shell: bash
if: ${{ inputs.permitted-licenses }}
- name: 'Add dependency approvals'
working-directory: ${{ inputs.base-path }}
run: |
echo "Configuring approved dependencies"
dependencies="${{ inputs.approved-dependencies }}"
for i in ${dependencies//,/ }
do
license_finder approvals add $i
done
shell: bash
if: ${{ inputs.approved-dependencies }}
- name: 'Report dependency licenses'
working-directory: ${{ inputs.base-path }}
run: |
echo "Report dependency licenses"
license_finder report
shell: bash
- name: 'Ensure license compliance'
working-directory: ${{ inputs.base-path }}
run: |
echo "Ensure license compliance"
license_finder
shell: bash