Skip to content

Remove the usage of the GitHub API to avoid rate limiting.#32

Draft
MarcelBochtler wants to merge 3 commits intomainfrom
remove-api-usage
Draft

Remove the usage of the GitHub API to avoid rate limiting.#32
MarcelBochtler wants to merge 3 commits intomainfrom
remove-api-usage

Conversation

@MarcelBochtler
Copy link
Member

@MarcelBochtler MarcelBochtler commented Feb 16, 2026

Unfortunately, #13 introduced multiple issues when running the action on GHES or on self-hosted runners.

  1. gh might not be available on self-hosted runners
  2. Authentication to github.com when running on GHES is cumbersome and requires a separate github.com account.

1) was already solved by #31, but 2) remains an issue.
Revert to the approach that was used before #13 to download latest from /releases/latest/download/....

This has the drawback that we won't know the version of latest before downloading it, and therefore (version based) caching becomes impossible.

The script already requires `bash` so use `[[` and `||` to improve
readability.

Signed-off-by: Marcel Bochtler <marcel.bochtler@bosch.com>
Remove the usage of the GitHub API to avoid any rate limiting.
The API was only used to retrieve the version of the `latest` version.

As this creates an issue in enterprise environments with shared IP
addresses and the usage of GHES, replace the API access with downloading
OSC from `/releases/latest/download/...`.

Unfortunately, this requires us to remove caching of the latest version.

Signed-off-by: Marcel Bochtler <marcel.bochtler@bosch.com>
As the OSC download no longer requires any authentication and rate
limiting is avoided by not using the GitHub API, remove the
`github-token` input parameter to simplify the usage of the action.

Signed-off-by: Marcel Bochtler <marcel.bochtler@bosch.com>
@sschuberth
Copy link
Contributor

This has the drawback that we won't know the version of latest before downloading it, and therefore (version based) caching becomes impossible.

I feel that this is a rather big drawback. I'm not sure whether it's acceptable for our users.

Instead of this back-and-forth, trying to cover all cases with a single action, I start to wonder whether we should simply create separate actions for github.com and GHES users...

@MarcelBochtler
Copy link
Member Author

MarcelBochtler commented Feb 16, 2026

Instead of this back-and-forth, trying to cover all cases with a single action, I start to wonder whether we should simply create separate actions for github.com and GHES users...

We're not only talking about github.com vs GHES. We're trying to cover:

  • github.com with built-in runners
  • github.com with self-hosted runners
  • GHES (maybe also with multiple runner variations)
  • Maybe even gitea compatibility?

How many variants of the action should we maintain?
All other GitHub actions I know of, manage to keep maintainability between all of these variants.

And we're already failing because we're trying to download the latest version of a 5 MB CLI?

I'm sure that we can support all the above-mentioned variants with a single action by sticking to some basic rules.

@sschuberth
Copy link
Contributor

How many variants of the action should we maintain?

To answer your rhetoric question: Of course the minimum number we need to maintain while still having readable GitHub action code.

by sticking to some basic rules.

And who defines those rules? For the example the rule that we must neither rely on gh nor jq?

@mnonnenmacher
Copy link
Contributor

mnonnenmacher commented Feb 16, 2026

To add another perspective, IMO defaulting to `latest' is the wrong approach anyway, because it involves the risk that the action fails if the used instance is not updated immediately after a new major release of the server was made. A more reasonable default would be to get the actual server version from https://eclipse-apoapsis.github.io/ort-server/api/get-versions and download the matching CLI.

Unfortunately, the versions endpoint requires authentication, which makes the implementation of that approach pretty complex.

https://api.github.com/repos/eclipse-apoapsis/ort-server/releases/latest \
| sed -n 's/.*"tag_name": *"\([^"]*\)".*/\1/p')
fi
LOWERCASE_OS=$(echo $RUNNER_OS | tr '[:upper:]' '[:lower:]')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also get the latest version from the location response header of the latest release URL, without using the API:

$ curl -sI https://github.com/eclipse-apoapsis/ort-server/releases/latest | grep -i "location"
location: https://github.com/eclipse-apoapsis/ort-server/releases/tag/0.52.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants