-
Notifications
You must be signed in to change notification settings - Fork 18
56 lines (47 loc) · 1.55 KB
/
deprecate.yaml
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
51
52
53
54
55
56
name: Deprecate ID
on:
pull_request_target:
branches:
- main
paths:
- 'utils/deprecated_ids.txt'
jobs:
validate:
name: Check that only valid files are part of PR
runs-on: ubuntu-latest
steps:
- name: Check PR File List
run: |
URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/${{ github.event.pull_request.number }}/files"
FILES=$(curl -s -X GET -G $URL | jq -r '.[] | .filename')
if [ $FILES = "utils/deprecated_ids.txt" ]; then
echo "Authorized Submission"
else
echo "Unauthorized Submission: Deletion requests must only contain edits to 'deprecated_ids.txt'"
exit 125
fi
- name: Checkout Base
uses: actions/checkout@v2
- name: Checkout PR
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
path: pr
- name: Configure new submission
run: |
mv pr/utils/deprecated_ids.txt utils/deprecated_ids.txt
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: build new indications
run: python utils/build_indications.py
- name: test new build with pytest
if: ${{ success() }}
run: |
pytest utils/test_indications.py