generated from cloudoperators/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (63 loc) · 1.92 KB
/
shared-license.yaml
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: "default"
type: string
apply_header:
description: "Apply automatically license header"
required: false
default: true
type: boolean
secrets:
github_token:
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@v4
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/[email protected]
with:
config: .github/licenserc.yaml
mode: fix
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@v4
with:
token: ${{ secrets.github_token != '' && secrets.github_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/[email protected]
with:
config: .github/licenserc.yaml
mode: fix
- name: Apply Changes
uses: EndBug/add-and-commit@v9
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
author_name: License Bot
author_email: [email protected]
message: 'Automatic application of license header'