-
Notifications
You must be signed in to change notification settings - Fork 23
50 lines (41 loc) · 1.28 KB
/
validate-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
46
47
48
49
50
name: Validate authors
on:
pull_request:
branches:
- main
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: "${{ github.event.pull_request.head.sha }}"
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
authors:
- '_data/authors.yml'
- name: Get all changed files
if: steps.filter.outputs.authors == 'true'
id: files
uses: Ana06/get-changed-files@v2.1.0
- uses: actions/setup-python@v2
if: steps.filter.outputs.authors == 'true'
with:
python-version: '3.x'
- name: Install python dependencies
if: steps.filter.outputs.authors == 'true'
run: |
pip install PyYAML python-frontmatter requests
- name: Get validation script from main branch
if: steps.filter.outputs.authors == 'true'
run: |
rm -rf _scripts
wget https://raw.githubusercontent.com/genicsblog/theme-files/main/_scripts/validate-authors.py -P _scripts
- name: Validate authors
if: steps.filter.outputs.authors == 'true'
run: |
echo "${{ steps.files.outputs.all }}" >> temp.txt
python _scripts/validate-authors.py ${{ github.event.pull_request.user.login }}
rm temp.txt