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

listMembersInOrg api always return 404 #518

Closed
PSinha1202 opened this issue Jan 21, 2025 · 2 comments
Closed

listMembersInOrg api always return 404 #518

PSinha1202 opened this issue Jan 21, 2025 · 2 comments
Labels
question A question on how to use this action

Comments

@PSinha1202
Copy link

Describe the bug
Tried the same url in Postman using the rest api and it returns me 200 while the script returns 400

const members = await github.rest.teams.listMembersInOrg({
org: context.repo.owner, --- does this need to be changed?
team_slug: ''
});

Results from actions:

request: { method: 'GET', url: 'https://api.github.com/orgs/<orgName>/teams/<team-slug>/members', // ---> this is the final url its hitting headers: { accept: 'application/vnd.github.v3+json', 'user-agent': 'actions/github-script octokit-core.js/3.6.0 Node.js/20.18.0 (darwin; arm64)', authorization: 'token [REDACTED]' }, request: { agent: [Agent], hook: [Function: bound bound register] } }

response:
data: { message: 'Not Found', documentation_url: 'https://docs.github.com/rest/teams/members#list-team-members', status: '404' }

Request in Postman client

https://api.github.com/orgs//teams//members

To Reproduce
run the above script and also the api in postman to see the diff in result.
[using script v6](uses: actions/github-script@v6)

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@PSinha1202
Copy link
Author

Possibly related #481 (comment)

as i was using the PAT token in Postman client

@joshmgross
Copy link
Member

The Actions GITHUB_TOKEN does not have access to organization permissions, so you'll need to use a PAT or GitHub App token and pass that to your actions/github-script.

https://github.com/actions/github-script?tab=readme-ov-file#using-a-separate-github-token

@joshmgross joshmgross added the question A question on how to use this action label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question A question on how to use this action
Projects
None yet
Development

No branches or pull requests

2 participants