Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

What permissions are required for github.rest.teams.listMembersInOrg? #481

Unanswered
johnbatclari asked this question in Q&A
Discussion options

I'm struggling to find what permissions are required to be able to make github.rest.teams.listMembersInOrg calls. I'm currently getting 404's when a workflow is triggered by a pull_request, though I can successfully execute the workflow if I run it using netkos/act locally. I've searched docs without success. Any help would be much appreciated!

Currently configured permissions:

permissions:
 contents: read
 pull-requests: write

And the call in question:

 - name: Check for approvals
 id: needs-approvals
 uses: actions/github-script@v7
 with:
 github-token: ${{ secrets.GITHUB_TOKEN }}
 script: |
 const { data: approvalTeamMembers } = await github.rest.teams.listMembersInOrg({
 org: 'myorg',
 team_slug: 'myteam'
 });
 console.debug(`Team members: ${approvalTeamMembers.map(member => member.login).join(', ')}`);
You must be logged in to vote

Replies: 1 comment

Comment options

👋 This would require the "Members" organization permissions (read) permission per: https://docs.github.com/en/rest/orgs/members?apiVersion=2022年11月28日#list-organization-members

The Actions GITHUB_TOKEN does not have organization permissions, so you'd need to use a personal access token (PAT) or GitHub App token.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /