Skip to content

Commit

Permalink
hotfix/repair auto assigning reviewers
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Drebenstedt <[email protected]>
  • Loading branch information
cutoffthetop authored Mar 5, 2024
1 parent 77ce51f commit 1216531
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions mex-{{ cookiecutter.project_name }}/.github/workflows/reviewing.yml
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 %}

0 comments on commit 1216531

Please sign in to comment.