-
Notifications
You must be signed in to change notification settings - Fork 1.5k
46 lines (43 loc) · 1.71 KB
/
authors.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
37
38
39
40
41
42
43
44
45
name: New Authors Check
on:
pull_request:
jobs:
check-id:
name: New Author Check
runs-on: ubuntu-latest
steps:
- run: sudo apt -y install git
- run: git clone https://github.com/${{ github.repository }}
- run: git remote add author ${{ github.event.pull_request.head.repo.html_url }}
working-directory: suricata
- run: git fetch author
working-directory: suricata
- run: git checkout author/${{ github.event.pull_request.head.ref }}
working-directory: suricata
- name: Export known authors from master branch
run: git log --format="%an <%ae>" origin/master | sort | uniq > ../authors.txt
working-directory: suricata
- name: Export authors from new commits
run: git log --format="%an <%ae>" origin/${GITHUB_BASE_REF}... | sort | uniq > ../commit-authors.txt
working-directory: suricata
- name: Check new authors
run: |
touch new-authors.txt
while read -r author; do
echo "Checking author: ${author}"
if ! grep -q "^${author}\$" authors.txt; then
echo "ERROR: ${author} NOT FOUND"
echo "::warning ::New author found: ${author}"
echo "${author}" >> new-authors.txt
echo has_new_authors="yes" >> $GITHUB_ENV
fi
done < commit-authors.txt
- run: mkdir new-authors
- run: cp new-authors.txt new-authors
- run: echo ${{ github.event.number }} > new-authors/pr-number.txt
- run: ls -l
- name: Upload new authors
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
with:
name: new-authors
path: new-authors