Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fix license header job #298

Merged
merged 4 commits into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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