-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump cookiecutter template to 121653
- Loading branch information
1 parent
a6bf113
commit 01f483e
Showing
2 changed files
with
11 additions
and
10 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
name: Review | ||
name: Reviewing | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
workflow_dispatch: | ||
- reopened | ||
|
||
jobs: | ||
assignee: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
if: >- | ||
github.event.pull_request.user.login != ${{ vars.MEX_BOT_USER }} && | ||
github.event.pull_request.user.login != 'dependabot[bot]' | ||
steps: | ||
- name: Add assignee | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
user_name="${{ github.event.pull_request.user.login }}" | ||
user_type=$(gh api "users/${user_name}" --jq ".type") | ||
echo $user_name is a $user_type | ||
if [[ "$user_type" != "User" ]]; then | ||
user_name="${{ vars.MEX_BOT_USER }}" | ||
echo using $user_name instead | ||
fi | ||
if [[ -z "${{ github.event.pull_request.assignee.login }}" ]]; then | ||
echo assigning to ${{ github.event.pull_request.user.login }} | ||
gh pr edit ${{ github.event.pull_request.html_url }} --add-assignee ${{ github.event.pull_request.user.login }} | ||
else | ||
echo already assigned | ||
gh pr edit ${{ github.event.pull_request.html_url }} --add-assignee "${user_name}" | ||
fi |