-
Notifications
You must be signed in to change notification settings - Fork 73
73 lines (65 loc) · 1.89 KB
/
license_check.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
61
62
63
64
65
66
67
68
69
70
71
72
73
name: License Check Workflow
on:
workflow_call:
inputs:
working_directory:
required: false
type: string
default: "."
runs_on:
required: false
type: string
default: "ubuntu-latest"
dart_sdk:
required: false
type: string
default: "stable"
allowed:
required: false
type: string
default: "MIT,BSD-3-Clause,BSD-2-Clause,Apache-2.0"
forbidden:
required: false
type: string
default: ""
skip_packages:
required: false
type: string
default: ""
dependency_type:
required: false
type: string
default: "direct-main,transitive"
ignore_retrieval_failures:
required: false
type: boolean
default: false
secrets:
ssh_key:
required: false
jobs:
build:
defaults:
run:
working-directory: ${{inputs.working_directory}}
runs-on: ${{inputs.runs_on}}
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v4
- name: 🎯 Setup Dart
uses: dart-lang/setup-dart@v1
with:
sdk: ${{inputs.dart_sdk}}
- name: 🤫 Set SSH Key
env:
ssh_key: ${{secrets.ssh_key}}
if: env.ssh_key != null
uses: webfactory/[email protected]
with:
ssh-private-key: ${{secrets.ssh_key}}
- name: 📦 Install Dependencies
run: dart pub get --no-example
- name: 👨⚖️ Check licenses
run: |
dart pub global activate very_good_cli
dart pub global run very_good_cli:very_good packages check licenses --skip-packages=${{inputs.skip_packages}} --dependency-type=${{inputs.dependency_type}} ${{(inputs.ignore_retrieval_failures && '--ignore-retrieval-failures') || ''}} --allowed=${{inputs.allowed}} --forbidden=${{inputs.forbidden}}