Conversation
|
@DariuszPorowski I'll give this a shot in a little while and will update with results. |
| | `pyflakes` | false | `bool` | `true` | Use `pyflakes` with `actionlint` (and install if it does not exist) | | ||
| | `cache` | false | `bool` | `true` | Use GitHub cache for caching binaries for the next runs. | | ||
| | `github-token` | false | `string` | `github.token` | GitHub Token for API authentication. | | ||
| | `github-api-url` | false | `string` | `github.api_url` | GitHub REST API URL to connect to a different GitHub instance. For example, `https://my.github-enterprise-server.com/api/v3` | |
There was a problem hiding this comment.
This isn't actually needed in my option. github.api_url will point to the correct API URL of the GHES instance.
| id: environment | ||
| with: | ||
| github-token: ${{ inputs.token || env.GITHUB_TOKEN }} | ||
| github-token: ${{ inputs.github-token || inputs.token || env.GITHUB_TOKEN }} |
There was a problem hiding this comment.
This will not work (and breaks as expected in my tests due to a 401 error), because the token here will be my GHES token by default, which is unknown to GitHub. If I override the github-token option with a real GitHub.com token, then consequently the later steps which target my GHES API will fail due to always using the same configured token.
I think you would need to introduce an additional github-token-downloadurl (name just for illustration) which is used for the environment step. This can also default to ${{ github.api_url }}, thus remaining backwards compatible.
Additionally we should allow not using a token at all when accessing the API (unauthenticated request). These calls are heavily rate-limited, but our GHES workflow may not have access to any GitHub.com token at all.
The list releases API is available without authentication:
This endpoint can be used without authentication or the aforementioned permissions if only public resources are requested.
There was a problem hiding this comment.
@frederikb great input! thanks for checking. Going to address your suggestions today, and appreciate GHES test after will update this PR.
There was a problem hiding this comment.
@frederikb the problem with anonymous GH public api calls is, it's a very limited rate limits: The primary rate limit for unauthenticated requests is 60 requests per hour.
e401b42 to
5ca534f
Compare
💌 Description
🔗 Related issue
Fixes: #14
🏗️ Type of change
✅ Checklist
Code of Conductdocument.Contributingguide.