Skip to content

Commit 2a6bae6

Browse files
Add fix license header job (#298)
* Add fix license header job * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Ignore unsupported files * Fix syntax for folder to ignore Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 88f04d7 commit 2a6bae6

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Fix License Headers
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
10+
jobs:
11+
header-license-fix:
12+
runs-on: ubuntu-20.04
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
with:
17+
token: ${{ secrets.GITHUB_TOKEN }}
18+
19+
- name: Configure git to use https
20+
run: git config --global hub.protocol https
21+
22+
- name: Checkout the branch from the PR that triggered the job
23+
run: hub pr checkout ${{ github.event.pull_request.number }}
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Fix License Header
28+
uses: apache/skywalking-eyes/[email protected]
29+
with:
30+
mode: fix
31+
32+
- name: Get modified files in the staging directory
33+
id: changed-files
34+
uses: tj-actions/changed-files@v24
35+
36+
- name: Apply Changes
37+
if: steps.changed-files.outputs.any_changed == 'true'
38+
shell: bash -l {0}
39+
run: |
40+
git config user.name 'github-actions[bot]'
41+
git config user.email 'github-actions[bot]@users.noreply.github.com'
42+
git add *
43+
git commit -m "Automatic application of license header"
44+
45+
- name: Push fixes
46+
if: steps.changed-files.outputs.any_changed == 'true'
47+
shell: bash -l {0}
48+
run: |
49+
git config push.default upstream
50+
git push
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.licenserc.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
header:
2+
license:
3+
spdx-id: BSD-3-Clause
4+
copyright-owner: Jupyter Development Team
5+
software-name: JupyterLab
6+
content: |
7+
Copyright (c) Jupyter Development Team.
8+
Distributed under the terms of the Modified BSD License.
9+
10+
paths-ignore:
11+
- "**/*.json"
12+
- "**/*.md"
13+
- "**/*.po"
14+
- "**/*.svg"
15+
- "**/*.yml"
16+
- "**/*.yaml"
17+
- "**/.*"
18+
- "**/MANIFEST.in"
19+
- "LICENSE"
20+
- "jupyterlab_server/test_data"
21+
22+
comment: on-failure

0 commit comments

Comments
 (0)