diff --git a/.cruft.json b/.cruft.json index 90921cf8..041b19ed 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/robert-koch-institut/mex-template", - "commit": "77ce51f46b0897c6fbd29782c32923075e296c2a", + "commit": "12165319453990fdbe02bce39a3236337e298bc0", "checkout": null, "context": { "cookiecutter": { diff --git a/.github/workflows/reviewing.yml b/.github/workflows/reviewing.yml index 02833fda..223ea60a 100644 --- a/.github/workflows/reviewing.yml +++ b/.github/workflows/reviewing.yml @@ -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