Skip to content

Commit

Permalink
Add fix license header job (#298)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
fcollonval and pre-commit-ci[bot] authored Aug 23, 2022
1 parent 88f04d7 commit 2a6bae6
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/fix-license-header.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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@v24

- 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 }}
22 changes: 22 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
header:
license:
spdx-id: BSD-3-Clause
copyright-owner: Jupyter Development Team
software-name: JupyterLab
content: |
Copyright (c) Jupyter Development Team.
Distributed under the terms of the Modified BSD License.
paths-ignore:
- "**/*.json"
- "**/*.md"
- "**/*.po"
- "**/*.svg"
- "**/*.yml"
- "**/*.yaml"
- "**/.*"
- "**/MANIFEST.in"
- "LICENSE"
- "jupyterlab_server/test_data"

comment: on-failure

0 comments on commit 2a6bae6

Please sign in to comment.