-
Notifications
You must be signed in to change notification settings - Fork 221
52 lines (49 loc) · 1.97 KB
/
Copy pathlicense.yml
File metadata and controls
52 lines (49 loc) · 1.97 KB
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
name: License Compliance
# ## Summary
#
# This workflow runs the license_finder CLI only when it detects an update to files related to the License Finder.
on:
pull_request:
merge_group:
jobs:
license_finder:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# To make the success of this job a prerequisite for merging into the main branch,
# set a filter here instead of on: to determine whether or not to proceed to the next step.
- name: Cache dependency files
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
id: cache
with:
path: |
.github/workflows/license.yml
config/dependency_decisions.yml
config/license_finder.yml
package.json
pnpm-lock.yaml
key: license-${{ runner.os }}-${{ hashFiles('.github/workflows/license.yml', 'config/dependency_decisions.yml', 'config/license_finder.yml', 'package.json', 'pnpm-lock.yaml') }}
- name: Determine if files changed
id: determine
run: |
if [ "${{ steps.cache.outputs.cache-hit }}" = 'true' ]; then
echo "files_changed=false" >> "$GITHUB_OUTPUT"
else
echo "files_changed=true" >> "$GITHUB_OUTPUT"
fi
- uses: ./.github/actions/pnpm-setup
if: steps.determine.outputs.files_changed == 'true'
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1.229.0
if: steps.determine.outputs.files_changed == 'true'
with:
ruby-version: '3.4'
- name: Install License Finder
if: steps.determine.outputs.files_changed == 'true'
run: gem install -N license_finder
- name: Run License Finder
if: steps.determine.outputs.files_changed == 'true'
run: license_finder