vbem / multi-runners

Multi self-hosted runners on single host!
Apache License 2.0
118 stars 10 forks source link

Cannot iterate over null #8

Closed YogurtTheHorse closed 5 months ago

YogurtTheHorse commented 5 months ago

Running ./mr.bash download

Produces such error: jq: error (at <stdin>:1): Cannot iterate over null (null)

./mr.bash pat2token is working correctlym although

Not sure what steps to reproduce to put or any other info about my system.

YogurtTheHorse commented 5 months ago

I tried to investigate script myself a bit

Seems like the issue in github limits:

{"message":"API rate limit exceeded for X.X.X.X. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}
vbem commented 5 months ago

Hi @YogurtTheHorse,

That's right. For download, this wrapper get the latest runner version info from https://api.github.com/repos/actions/runner/releases/latest and use jq to parse the responsed JSON.

If there is a download rate limit issue, you can:

  1. Download the latest release into your Linux server /tmp/ directory, such as /tmp/actions-runner-linux-x64-2.315.0.tar.gz.
  2. Export an environment variable MR_RELEASE_URL=/tmp/actions-runner-linux-x64-2.315.0.tar.gz before running this wrapper. You can also define this environment variable in the .env file.
  3. Now this wrapper will use your local package instead of requesting GitHub API for the latest one.
YogurtTheHorse commented 5 months ago

Thanks!

Would be nice to have some way to pass PAT instead, though :)

vbem commented 5 months ago

Thanks!

Would be nice to have some way to pass PAT instead, though :)

No problem. As described in Authentication, to register a runner to any GitHub repo or org requires a temporary registration token as authentication method that you have this permission, which can be generated from PAT.

If you already got this temporary registration token from some other ways, you can always pass --token=xxxxxx to this wrapper instead of set PAT.