-
Notifications
You must be signed in to change notification settings - Fork 8
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
Error: not found when using action on self-hosted GHE and with.version
not explicitly set.
#49
Comments
Thank you for reporting the bug. Could you please test if the fix works for you? (Mind the different branch instead of - name: Check for lint
id: check-lint-
uses: astral-sh/ruff-action@github-base-url
with:
args: check --output-format=github . |
Nope.
Take a look at this comment from astral-sh/setup-uv#221. There are two conflating/co-morbid issues here:
The core issue is that I (in the plural sense; "I" means "everybody w/ GHE or similar") will only ever have an API token that is valid for |
Thank you for checking and providing the details. Seems like I have to pick up replacing octokit... |
@kquinsland can you please try again? I added a way to access the API without a token. I pushed 3dc8519 to the same branch. You should be able to rerun your workflow and fetch the latest state |
If there's no way to pass along a "do this as anon, no API token" flag, that would be a solution. but I'm not sure if that'll result in rate-limits or not. Perhaps a I could also see a "we know it's a problem, but GHE users are < 5% user base and the workaround isn't difficult so we'll re-visit this |
Nope :/.
Let me try using the hash explicitly... |
Ah. I assumed the token is an empty string. (I think someone mentioned it in the setup-uv issue). Let me replace this with a try/catch as you suggested |
- name: Check for lint violations
id: check-lint-rules
# Turns out, you can't use short hashes here. TIL!
uses: astral-sh/ruff-action@3dc85199c716fa0820c1a98d8baeb356eee22cf8
with:
# Very similar to the above, you need to explicitly set the version when
# using GHE instances.
# See: https://github.com/astral-sh/ruff-action/issues/49
##
# 0.9.2 is the latest version as of 2025-01
# version: "0.9.2"
args: check --output-format=github . Produces:
|
I'll spare you the long In any case, the GHA runtime (both "regular" GH and GHE) always has |
Can you please try again? I implemented the try/catch |
Which branch/ref? |
|
That did the trick:
|
Thanks for hanging in there with me! |
@kquinsland could you do me a favor and try again with the branch |
No, than you for being responsive and driving the fix :). (and for keeping the |
Sure thing. - name: Check for lint violations
id: check-lint-rules
uses: astral-sh/ruff-action@do-not-assume-github-token
with:
# Very similar to the above, you need to explicitly set the version when
# using GHE instances.
# See: https://github.com/astral-sh/ruff-action/issues/49
##
# 0.9.2 is the latest version as of 2025-01
# version: "0.9.2"
args: check --output-format=github . Produces:
no failure |
I have a pretty standard "setup python ci" flow that features a step like this:
When running on self-hosted GHA runners (because self-hosted GHE instance), I get the following error (this is with debug logs on):
As the logs indicate, my
pyproject.toml
does feature this line:Noting how similar the typescript code is, I figured that the same workaround here would work here:
Which works!
I think the issue is here: https://github.com/astral-sh/ruff-action/blob/main/src/ruff-action.ts#L109
Which calls into this:
Which - because the
pyproject.toml
has an expresison (>=0.9.2
) not a literal (0.9.2
), theif(){}
is false so we execute:which - for the same reasons detailed in astral-sh/setup-uv#221, results in an api/auth related error due to this not being "regular, public github".
The workaround
Is to explicitly set the
with.version
to an explicit version. That skips the logic that assumes regular github and goes straight to the actual "plug the version into the URL template, then fetch the URL" flow which has no issues.The text was updated successfully, but these errors were encountered: