-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (43 loc) · 1.41 KB
/
license-header.yml
File metadata and controls
52 lines (43 loc) · 1.41 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
name: Fix License Headers
on:
pull_request:
permissions:
contents: write
pull-requests: write
jobs:
header-license-fix:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure git to use https
run: git config --global hub.protocol https
- name: Checkout the branch from the PR that triggered the job
run: hub pr checkout ${{ github.event.pull_request.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Fix License Header
uses: apache/skywalking-eyes/header@v0.4.0
with:
mode: fix
- name: Get modified files in the staging directory
id: changed-files
uses: tj-actions/changed-files@v29.0.2
- name: Apply Changes
if: steps.changed-files.outputs.any_changed == 'true'
shell: bash -l {0}
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add *
git commit -m "Automatic application of license header"
- name: Push fixes
if: steps.changed-files.outputs.any_changed == 'true'
shell: bash -l {0}
run: |
git config push.default upstream
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}