-
Notifications
You must be signed in to change notification settings - Fork 30
47 lines (40 loc) · 1.61 KB
/
reviewers.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
name: Assign Reviewers for Uberon
on:
pull_request:
types: [opened, synchronize]
paths:
- src/ontology/uberon-edit.obo
jobs:
assign-reviewer:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch the entire history for all branches
- name: Fetch base branch
run: |
git fetch origin ${{ github.base_ref }} # Fetch base branch explicitly
- name: Check if equivalent class axiom was edited
id: check_intersection_of
run: |
git diff origin/${{ github.base_ref }}...HEAD -- src/ontology/uberon-edit.obo > diff.txt
if grep -E '^(-|\+)intersection_of:' diff.txt; then
echo "intersection_of_found=true" >> $GITHUB_ENV
else
echo "intersection_of_found=false" >> $GITHUB_ENV
fi
- name: Assign reviewer
if: env.intersection_of_found == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers \
--method POST \
--field reviewers[]=cmungall
- name: Block PR by requesting changes
if: env.intersection_of_found == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr review ${{ github.event.pull_request.number }} --request-changes --body "Changes detected in \`src/ontology/uberon-edit.obo\` involving \`intersection_of\`. Review by specific Uberon Core Team member is required."