-
Notifications
You must be signed in to change notification settings - Fork 540
What permissions are required for github.rest.teams.listMembersInOrg? #481
-
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(', ')}`);
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
👋 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.
Beta Was this translation helpful? Give feedback.