Skip to content

Commit d0d9a72

Browse files
committed
pass the token input through on GHES
Signed-off-by: CrazyMax <[email protected]>
1 parent a8165e7 commit d0d9a72

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ ___
2828
* [Notes](#notes)
2929
* [`nodes` output](#nodes-output)
3030
* [BuildKit container logs](#buildkit-container-logs)
31+
* [Using on GHES](#using-on-ghes)
3132
* [Contributing](#contributing)
3233

3334
## Usage
@@ -174,6 +175,35 @@ The following [official docker environment variables](https://docs.docker.com/en
174175

175176
See https://docs.docker.com/build/ci/github-actions/configure-builder/#buildkit-container-logs
176177

178+
## Using on GHES
179+
180+
GitHub Runners come [pre-installed with Docker Buildx](https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md)
181+
following your virtual environment. If you specify a version or `latest` of
182+
Docker Buildx in your workflow, the version will be downloaded from [GitHub Releases in `docker/buildx`](https://github.com/docker/buildx/releases)
183+
repository. These calls to `docker/buildx` are made via unauthenticated requests,
184+
which are limited to [60 requests per hour per IP](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting).
185+
186+
If more requests are made within the time frame, then you will start to see
187+
rate-limit errors during downloading that looks like:
188+
189+
```
190+
##[error]API rate limit exceeded for...
191+
```
192+
193+
To get a higher rate limit, you can [generate a personal access token on github.com](https://github.com/settings/tokens/new)
194+
and pass it as the `github_token` input for the action:
195+
196+
```yaml
197+
uses: docker/setup-buildx-action@v3
198+
with:
199+
github_token: ${{ secrets.GH_DOTCOM_TOKEN }}
200+
version: v0.10.1
201+
```
202+
203+
If the runner is not able to access `github.com`, it will take the default one
204+
available on the GitHub Runner or runner's tool cache. See "[Setting up the tool cache on self-hosted runners without internet access](https://docs.github.com/en/[email protected]/admin/github-actions/managing-access-to-actions-from-githubcom/setting-up-the-tool-cache-on-self-hosted-runners-without-internet-access)"
205+
for more information.
206+
177207
## Contributing
178208

179209
Want to contribute? Awesome! You can find information about contributing to

action.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,14 @@ inputs:
4545
description: 'Append additional nodes to the builder'
4646
required: false
4747
github_token:
48-
description: 'The GitHub token used to create an authenticated client for GitHub API'
49-
default: ${{ github.token }}
50-
required: false
48+
# https://github.com/actions/setup-go/blob/21459d0b7b1d63741429b748885bf5a4974593b4/action.yml#L12-L14
49+
description: >
50+
Used to verifiy the Git tag exists on docker/buildx repo. Since there's a
51+
default, this is typically not supplied by the user. When running this
52+
action on github.com, the default value is sufficient. When running on
53+
GHES, you can pass a personal access token for github.com if you are
54+
experiencing rate limiting.
55+
default: ${{ github.server_url == 'https://github.com' && github.token || '' }}
5156

5257
outputs:
5358
name:

0 commit comments

Comments
 (0)