-
Notifications
You must be signed in to change notification settings - Fork 6
36 lines (30 loc) · 1.21 KB
/
check_headers.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
name: Check License Agreement in headers
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
jobs:
check_headers:
runs-on: ubuntu-22.04
name: Check Source Headers
timeout-minutes: 2
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install license-header-checker to ./tool/license-header-checker/bin
working-directory: ./tool/license-header-checker
run: ./do-license-header-check.sh --install
- name: Run license check and modification (container only)
working-directory: ./tool/license-header-checker
run: ./do-license-header-check.sh --fix
- name: Show changed files and fail if there are any
id: check-status
run: |
git status -s
[[ -z `git status -s` ]]
- name: Show hint for fix (on failure)
if: failure() && steps.check-status.outcome == 'failure'
run: |
echo "Please run './tool/license-header-checker/do-license-header-check.sh --fix' from bash to repair the headers."
echo "Or add the files to './tool/license-header-checker/ignore-filter.txt' if no header desired."
exit 1