trstringer / manual-approval

Pause your GitHub Actions workflow and request manual approval from set approvers before continuing
MIT License
405 stars 97 forks source link

422 Validation Failed [{Resource:Issue Field:assignees Code:invalid Message:}] #109

Open ashishjullia opened 1 year ago

ashishjullia commented 1 year ago

Used the following values for github team and token: image

But I'm getting the following error: Note: The same setup was working in other repo 2 days back but today I created a new repo but not working.

error creating issue: POST https://api.github.com/repos/EQWorks/eq-mwaa/issues: 422 Validation Failed [{Resource:Issue Field:assignees Code:invalid Message:}]

ashishjullia commented 1 year ago

So for the same setup, one repo was able to expand the github team for the list of users and was able to create an issue tagging them but this new repo with the same setup wasn't able to create an issue with same team but when I specifically mentioned user names then the issue was resolved, I'm not sure why this behavior.

wangxued commented 1 year ago

Yes, I have same issue on this


  wait-for-approval:
    runs-on: ubuntu-latest
    permissions:
      issues: write
    needs: [get-some-vars,build-to-acr,deploy-to-sit1]
    steps:
      - uses: trstringer/manual-approval@v1
        env:
          current_version: ${{ needs.get-some-vars.outputs.release_number }}
        with:
          secret: ${{ github.TOKEN }}
          approvers: user01,user02,team01
          minimum-approvals: 1
          issue-title: "Deploying ${{ env.current_version }} to pre"
          issue-body: "Please approve or deny the deployment of version ${{ env.current_version }}."
          exclude-workflow-initiator-as-approver: false
          additional-approved-words: ''
          additional-denied-words: ''
iarovyi commented 11 months ago

I got the same problem: error creating issue: POST https://api.github.com/repos/xxx/xxx/issues: 422 Validation Failed [{Resource:Issue Field:assignees Code:invalid Message:}]

The code used:

    - name: Approval
      uses: trstringer/manual-approval@dd1555b1d17966cb58500676d79a181c53bb6c12
      with:
        secret: "......."
        approvers: "my-group"
        minimum-approvals: 1
        issue-title: "......"
        issue-body: "......"
        exclude-workflow-initiator-as-approver: false

It used to work and suddenly it broke when new user was added to the group. I tested it on multiple repositories and all comes down to single specific user. If group has this user or this user is specified directly than it fails.

Documentation says:

approvers is a comma-delimited list of all required approvers. An approver can either be a user or an org team. (Note: Required approvers must have the ability to be set as approvers in the repository. If you add an approver that doesn't have this permission then you would receive an HTTP/402 Validation Failed error when running this action)

Not sure what means the ability to be set as approvers in the repository

UPDATE: it turns out that this situation happens when specific user does not have enough rights on repository. Once user was given enough rights than problem was solved.

sheikhasim commented 10 months ago

In my case , we had a user with no repository access granted in GHE setup. Removing the user from the approvers list solved the issue.