pozil / auto-assign-issue

GitHub Action that auto-assigns issues or PRs to one or more users
Creative Commons Zero v1.0 Universal
52 stars 27 forks source link

Allow Github App access token for teams #91

Closed figadore closed 1 year ago

figadore commented 1 year ago

Important Requirement: if using the teams input parameter, you need to use a personal access token with read:org scope (the default GITHUB_TOKEN is not enough).

We can't use personal access tokens here, so I'm trying to get this to work with a Github App's access token. I've given the app permission to read the org's members and teams image

I'm using an action that returns an access token for the app, but it doesn't seem to work in the repo-token field

The error I'm getting is

node:internal/process/promises:246
          triggerUncaughtException(err, true /* fromPromise */);
          ^

Error: Failed to retrieve team members
    at /home/runner/work/_actions/pozil/auto-assign-issue/v1/src/utils.js:41:24
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async getTeamMembers (/home/runner/work/_actions/pozil/auto-assign-issue/v1/src/utils.js:33:32)
    at async runAction (/home/runner/work/_actions/pozil/auto-assign-issue/v1/src/action.js:95:29)
Caused by: HttpError: Not Found
    at /home/runner/work/_actions/pozil/auto-assign-issue/v1/node_modules/@octokit/request/dist-node/index.js:86:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Promise.all (index 0)
    at async getTeamMembers (/home/runner/work/_actions/pozil/auto-assign-issue/v1/src/utils.js:33:32)
    at async runAction (/home/runner/work/_actions/pozil/auto-assign-issue/v1/src/action.js:95:29)

(I may also be specifying the team incorrectly. Is it teams: @<org>/<team-name>, teams: <org>/<team-name>, or just teams: <team-name>?)

figadore commented 1 year ago

ignore me, it just started working, not sure why and to answer my sub-question, the correct format is teams: <team-name> as the readme seems to indicate

pozil commented 1 year ago

Glad that you were able to solve the issue. There's a team example in the readme but I'll update the docs to make the format even clearer.