Skip to content
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

Support for GHES #110

Open
isaacsanders opened this issue Nov 6, 2024 · 13 comments · May be fixed by #111
Open

Support for GHES #110

isaacsanders opened this issue Nov 6, 2024 · 13 comments · May be fixed by #111

Comments

@isaacsanders
Copy link

There's some complications with the use of the the action in GHES. The first of which is the use of the default token. The GHES token certainly doesn't work for public GitHub, which incidentally blocks us from getting lein installed. Being able to pass in an empty string would be helpful, but with an empty string, the "Bearer " still gets set as the auth, rather than being undefined. A lot of this gets fixed once we get an upstream github token, but that isn't always straightforward.

@DeLaGuardo
Copy link
Owner

What is GHES?

I think it would be safer to add an explicit option to not add an “Authorization” header instead of a blank line. Something like

      - name: Install clojure tools
        uses: DeLaGuardo/[email protected]
        with:
          no_auth: true
          lein: 2.9.1

What do you think?

@isaacsanders
Copy link
Author

GitHub Enterprise Server

@isaacsanders
Copy link
Author

I think that could work well

@DeLaGuardo DeLaGuardo linked a pull request Nov 8, 2024 that will close this issue
@DeLaGuardo
Copy link
Owner

@isaacsanders could you try to run from the branch?

        uses: DeLaGuardo/setup-clojure@ac5052cad8ffe5039f26968da4b4a0ca88d00971
        with:
          no-auth: 'true'

@isaacsanders
Copy link
Author

@DeLaGuardo This worked for me

@PEZ
Copy link

PEZ commented Dec 9, 2024

This worked for me too for running locally using nektos/act. However on Github I get errors about exceeding non-authorized quotas. Also when trying with no-auth: 'false'. Removing no-auth completely makes it work again.

UPDATE: I was a bad tester. I think it actually works setting it to 'false'.

@isaacsanders
Copy link
Author

These are unauthorized requests, and you will run into quotas if you don't cache the results.

@PEZ
Copy link

PEZ commented Dec 9, 2024

These are unauthorized requests, and you will run into quotas if you don't cache the results.

You mean it isn't related to using the no-auth directive?

@isaacsanders
Copy link
Author

I'm saying it is a direct consequence and known aspect of using the no-auth parameter.

@isaacsanders
Copy link
Author

on github you are using an IP address within the runner that is likely used by a great number of other people, so the rate will be limited. Locally, on your machine, you are less likely to have used all of the requests according to the rate limit. I used GHES, the enterprise offering, so the autogenerated token from GHA isn't valid for the authentication if generated from GHES, since it is a token for that server, not public github.

@PEZ
Copy link

PEZ commented Dec 10, 2024

My point was that I expected that when I set no-auth to false, I would get the “normal” authenticated behaviour that I get when I omit the directive.

And, important: I tested it in a bad way. It actually seems that my assumption may have been correct. Sorry about the noise!

@DeLaGuardo
Copy link
Owner

I just published a new version with no auth header in HTTP calls when explicit empty github-token is provided.

To test it in your environment please use following snippet:

      - name: Install all the tools
        uses: DeLaGuardo/[email protected]
        with:
          cli: latest
          lein: latest
          boot: latest
          bb: latest
          clj-kondo: latest
          cljstyle: latest
          zprint: latest

          # Explicit empty string should trigger "no auth" workflow
          # this will not set Authorisation header for any GitHub API http calls
          github-token: ''

@isaacsanders
Copy link
Author

This works great, thank you @DeLaGuardo!

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 a pull request may close this issue.

3 participants