Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ashishjullia opened this issue Oct 23, 2023 · 4 comments

Comments

@ashishjullia
Copy link

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
Copy link
Author

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
Copy link

wangxued commented Nov 3, 2023

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
Copy link

iarovyi commented Nov 15, 2023

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants