Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Move license check to separate file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Heinrich Kuttler committed Sep 20, 2021
1 parent b573f56 commit 2dec456
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 20 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/check_license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Check license

on:
pull_request:
branches:
- main

jobs:
test_license:
name: Check license headers
steps:
- uses: actions/checkout@v2

- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]

- name: Check copyright header in added files
- shell: bash
- run: |
missing=0
for file in "${{ steps.changed-files.outputs.added_files }}"; do
if ! egrep -q '(Facebook, Inc(\.|,)? and its affiliates)|([0-9]{4}-present(\.|,)? Facebook)|([0-9]{4}(\.|,)? Facebook)' $file
echo "Missing copyright header in $file"
missing=$(expr $missing + 1)
done
exit $missing
20 changes: 0 additions & 20 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,6 @@ on:


jobs:
test_license:
name: Check license headers
steps:
- uses: actions/checkout@v2

- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]

- name: Check copyright header in added files
- shell: bash
- run: |
missing=0
for file in "${{ steps.changed-files.outputs.added_files }}"; do
if ! egrep -q '(Facebook, Inc(\.|,)? and its affiliates)|([0-9]{4}-present(\.|,)? Facebook)|([0-9]{4}(\.|,)? Facebook)' $file
echo "Missing copyright header in $file"
missing=$(expr $missing + 1)
done
exit $missing
test_repo:
name: Test on ${{ matrix.os }} w/ Py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
Expand Down

0 comments on commit 2dec456

Please sign in to comment.