-
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.
hotfix/repair auto assigning reviewers
Signed-off-by: Nicolas Drebenstedt <[email protected]>
- Loading branch information
1 parent
77ce51f
commit 1216531
Showing
1 changed file
with
14 additions
and
11 deletions.
There are no files selected for viewing
25 changes: 14 additions & 11 deletions
25
mex-{{ cookiecutter.project_name }}/.github/workflows/reviewing.yml
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,29 @@ | ||
name: Review | ||
name: Reviewing | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
workflow_dispatch: | ||
- reopened | ||
|
||
jobs: | ||
assignee: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
if: >- | ||
{% raw %}github.event.pull_request.user.login != ${{ vars.MEX_BOT_USER }} &&{% endraw %} | ||
github.event.pull_request.user.login != 'dependabot[bot]' | ||
steps: | ||
- name: Add assignee | ||
env: | ||
{% raw %}GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}{% endraw %} | ||
run: | | ||
{% raw %}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 | ||
fi{% endraw %} | ||
{% raw -%} | ||
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 | ||
gh pr edit ${{ github.event.pull_request.html_url }} --add-assignee "${user_name}" | ||
fi | ||
{%- endraw %} |