github / privileged-requester

Privileged Requester Action
MIT License
15 stars 2 forks source link

Action uses always robot PAT even if default GITHUB_TOKEN should be used #119

Closed martinm82 closed 9 months ago

martinm82 commented 10 months ago

First of all, thanks a lot for this great action 💯

Problem When using the latest version of the action and defining only myToken, the action returns the following error:

Robot User configured. I will use that PAT instead.

/home/runner/work/privileged-requester/privileged-requester/node_modules/@actions/github/lib/internal/utils.js:26
        throw new Error('Parameter token or opts.auth is required');
^
Error: Parameter token or opts.auth is required
    at Object.getAuthString (/home/runner/work/privileged-requester/privileged-requester/node_modules/@actions/github/lib/internal/utils.js:26:1)
    at Object.getOctokitOptions (/home/runner/work/privileged-requester/privileged-requester/node_modules/@actions/github/lib/utils.js:47:1)
    at Object.getOctokit (/home/runner/work/privileged-requester/privileged-requester/node_modules/@actions/github/lib/github.js:34:1)
    at new GitHubProvider (/home/runner/work/privileged-requester/privileged-requester/src/github-provider.js:9:1)
    at /home/runner/work/privileged-requester/privileged-requester/index.js:17:1
    at /home/runner/work/privileged-requester/privileged-requester/dist/index.js:37337:3
    at Object.<anonymous> (/home/runner/work/privileged-requester/privileged-requester/dist/index.js:37340:[12](https://github.com/github/privileged-requester/actions/runs/6855016861/job/18639179727#step:3:13))
    at Module._compile (node:internal/modules/cjs/loader:1241:[14](https://github.com/github/privileged-requester/actions/runs/6855016861/job/18639179727#step:3:15))
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)

This happens in our repos and as well on pull requests within this repository, e.g., https://github.com/github/privileged-requester/actions/runs/6855016861/job/18639179727#step:3:11

Screenshot 2023-11-15 at 09 29 45

Workaround Currently the only workaround I found is to use robotToken and pass secrets.GITHUB_TOKEN to it.

GrantBirki commented 9 months ago

Thank you for bringing this to our attention! This has now been resolved with v2.0.0.

Please note that this new release contains breaking changes. See the release notes for more details.

Thanks!