-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(action): add base-url #22
base: main
Are you sure you want to change the base?
Conversation
@DariuszPorowski I'll give this a shot in a little while and will update with results. |
README.md
Outdated
| `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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't actually needed in my option. github.api_url
will point to the correct API URL of the GHES instance.
action.yml
Outdated
@@ -86,7 +96,8 @@ runs: | |||
uses: actions/github-script@v7 | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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 Conduct
document.Contributing
guide.