manual-approval icon indicating copy to clipboard operation
manual-approval copied to clipboard

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

Open ashishjullia opened this issue 8 months ago • 4 comments

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 avatar Oct 23 '23 20:10 ashishjullia

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.

ashishjullia avatar Oct 24 '23 03:10 ashishjullia

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: ''

wangxued avatar Nov 03 '23 02:11 wangxued

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.

iarovyi avatar Nov 15 '23 15:11 iarovyi

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.

sheikhasim avatar Jan 04 '24 11:01 sheikhasim