-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (63 loc) · 2.11 KB
/
shared-license.yaml
File metadata and controls
71 lines (63 loc) · 2.11 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Shared Check & Fix License Header
on:
workflow_call:
inputs:
runs-on:
description: "The runner to use for the job"
required: false
default: "ubuntu-latest"
type: string
apply_header:
description: "Apply automatically license header"
required: false
default: true
type: boolean
secrets:
pas:
description: "The token to use for the job"
required: false
jobs:
build-license-eye:
name: Build LicenseEye
if: inputs.apply_header == false
runs-on: ${{ inputs.runs-on}}
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Check License Header
uses: apache/skywalking-eyes/header@5c5b974209f0de5d905f37deb69369068ebfc15c # v0.7.0
with:
config: .github/licenserc.yaml
mode: check
apply-license-header:
name: Apply LicenceHeader
if: inputs.apply_header == true
runs-on: ${{ inputs.runs-on }}
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
token: ${{ secrets.pas != '' && secrets.pas || secrets.GITHUB_TOKEN }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Check License Header
uses: apache/skywalking-eyes/header@5c5b974209f0de5d905f37deb69369068ebfc15c # v0.7.0
with:
config: .github/licenserc.yaml
mode: fix
- name: Apply Changes
uses: EndBug/add-and-commit@290ea2c423ad77ca9c62ae0f5b224379612c0321 # v10
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
author_name: License Bot
author_email: license_bot@github.com
message: 'Automatic application of license header'