Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub action that assigns reviewers when equivalent class axioms are updated #3425

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/reviewers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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."
matentzn marked this conversation as resolved.
Show resolved Hide resolved