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

use Octokit client to download buildx #191

Merged
merged 2 commits into from Jan 28, 2023

Conversation

crazy-max
Copy link
Member

fixes #190

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
@crazy-max crazy-max merged commit a024221 into docker:master Jan 28, 2023
@rmg
Copy link

rmg commented Jan 28, 2023

Using @actions/github for this will break GH enterprise usage because it would try to download the release from the GH enterprise server it is running on instead of github.com

@crazy-max
Copy link
Member Author

crazy-max commented Jan 28, 2023

@rmg So needs to enforce server url in octokit?

@crazy-max crazy-max deleted the fix-dl-release branch January 28, 2023 01:09
@crazy-max crazy-max restored the fix-dl-release branch January 28, 2023 01:09
@crazy-max
Copy link
Member Author

crazy-max commented Jan 28, 2023

@rmg You mean https://github.com/actions/toolkit/tree/main/packages/github#usage?:

Returns an authenticated Octokit client that follows the machine proxy settings and correctly sets GHES base urls. See https://octokit.github.io/rest.js for the API.

That doesn't look to be related

@rmg
Copy link

rmg commented Jan 28, 2023

Having it as an input is good, but making the default a little smarter would be good, eg: from actions/setup-go:action.yml:

  token:
    description: Used to pull node distributions from go-versions. Since there's a default, this is typically not supplied by the user. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting.
    default: ${{ github.server_url == 'https://github.com' && github.token || '' }}

@rmg
Copy link

rmg commented Jan 28, 2023

@actions/github creates the client using process.env['GITHUB_API_URL'] which will be different on GHES.

@tonistiigi
Copy link
Member

@rmg Is there a place where we can hardcode it to api.github.com on initialization?

@crazy-max
Copy link
Member Author

crazy-max commented Jan 28, 2023

I think with:

      .getOctokit(githubToken, {
        baseUrl: config.GITHUB_API_URL
      })

@crazy-max
Copy link
Member Author

@rmg Ah yes just found actions/toolkit#449

@rmg
Copy link

rmg commented Jan 28, 2023

FWIW it took GitHub a few tries to get this right for their own actions: https://github.com/actions/setup-python/pulls?q=is%3Apr+token+is%3Aclosed

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.

Cannot find buildx v0.9.1 release
3 participants