forked from facebookresearch/nle
-
Notifications
You must be signed in to change notification settings - Fork 10
36 lines (30 loc) · 939 Bytes
/
check_license.yml
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
---
name: Check license
on:
push:
jobs:
check_license:
name: Check license headers
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v1.1.2
- name: Check copyright header in added files
shell: bash
run: |
missing=0
if [ -z "${{ steps.changed-files.outputs.added_files }}" ]; then
exit 0
fi
for file in "${{ steps.changed-files.outputs.added_files }}"; do
echo "$file was modified"
if ! egrep -q '(Facebook, Inc(\.|,)? and its affiliates)|([0-9]{4}-present(\.|,)? Facebook)|([0-9]{4}(\.|,)? Facebook)' $file; then
echo "Missing copyright header in $file"
missing=$(expr $missing + 1)
fi
done
exit $missing