feat(ghes): fetch tool from configurable server#22
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
|
Is there hope that this will be fixed anytime soon? I'm trying to use actionlint inside of a GitHub Enterprise instance and it is constantly failing with 404 errors |
|
Me either. |
05c802a to
0b18e85
Compare
✅MegaLinter analysis: Success
Notices📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining See detailed reports in MegaLinter artifacts MegaLinter is graciously provided by OX Security |
Adds a github-server-url input (default https://github.com) used to build the release lookup (redirect), binary download, matcher, and API fallback URLs. By default the external rhysd/actionlint tool is always fetched from public github.com, so the GHES API is never queried for it; GHES users who mirror rhysd/actionlint can point the action at their own server.
0b18e85 to
50d473f
Compare
…description Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
💌 Description
🔗 Related issue
Fixes: #14
🏗️ Type of change
✅ Checklist
Code of Conductdocument.Contributingguide.