-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (39 loc) · 1.26 KB
/
license-check-reusable.yml
File metadata and controls
45 lines (39 loc) · 1.26 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
name: License Check (Reusable)
on:
workflow_call:
jobs:
license-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 1
- name: Setup mise
uses: jdx/mise-action@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
cache: true
cache_key_prefix: mise-license-check
- name: Check if license task exists
id: check-task
run: |
if mise tasks 2>/dev/null | grep -q "lint:licenses"; then
echo "exists=true" >> $GITHUB_OUTPUT
echo "✓ Found mise lint:licenses task"
else
echo "exists=false" >> $GITHUB_OUTPUT
echo "⚠ No mise lint:licenses task found"
fi
- name: Run license check
if: steps.check-task.outputs.exists == 'true'
run: mise run lint:licenses
- name: Fail if task missing
if: steps.check-task.outputs.exists == 'false'
run: |
echo "❌ License check task not found"
echo ""
echo "Either:"
echo "1. Implement mise lint:licenses task in this repository"
echo "2. Remove the license-check workflow if not needed for this repo"
exit 1