Azure devops integration for your version #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Assign and add reviewers on mention | |
on: | |
issue_comment: | |
types: [created, edited] | |
jobs: | |
pr_commented: | |
name: Add mentioned user as reviewer | |
if: ${{ github.event.issue.pull_request }} | |
runs-on: ubuntu-latest | |
steps: | |
- run: | | |
MENTIONS=$(echo "$BODY" | grep -oh "@[[:alnum:]-]*") | |
for X in $MENTIONS; do | |
gh pr edit $ISSUE --add-reviewer ${X#@} || true | |
done | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
ISSUE: ${{ github.event.issue.html_url }} | |
BODY: ${{ github.event.comment.body }} | |
issue_commented: | |
name: Add mentioned user to issue assignees | |
if: ${{ !github.event.issue.pull_request }} | |
runs-on: ubuntu-latest | |
steps: | |
- run: | | |
MENTIONS=$(echo "$BODY" | grep -oh "@[[:alnum:]-]*") | |
for X in $MENTIONS; do | |
gh issue edit $ISSUE --add-assignee ${X#@} || true | |
done | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
ISSUE: ${{ github.event.issue.html_url }} | |
BODY: ${{ github.event.comment.body }} | |
permissions: | |
issues: write | |
pull-requests: write | |