Skip to content

Commit a155493

Browse files
authored
add GITHUB_TOKEN to some GHA workflows (#2624)
## Summary Got this error from a recent CICD failure: https://github.com/jetify-com/devbox/actions/runs/15422512862/job/43401117195 ``` Error: nix: command error: nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' flake metadata --json github:NixOS/nixpkgs/nixpkgs-unstable: unable to download 'https://api.github.com/repos/NixOS/nixpkgs/commits/nixpkgs-unstable': HTTP error 403: exit code 1 time=2025-06-03T16:18:44.819Z level=ERROR source=/Users/runner/work/devbox/devbox/internal/boxcli/midcobra/debug.go:68 msg="command error" stderr="error:\n … while fetching the input 'github:NixOS/nixpkgs/nixpkgs-unstable'\n\n error: unable to download 'https://api.github.com/repos/NixOS/nixpkgs/commits/nixpkgs-unstable': HTTP error 403\n\n response body:\n\n {\"message\":\"API rate limit exceeded for 13.105.117.137. (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\"}\n" execid=56fcbe21ff4a4759b3aa59c59d79e8a8 stack=<nil> ``` ... ``` time=2025-06-03T16:18:44.820Z level=DEBUG source=/Users/runner/work/devbox/devbox/internal/nix/flake.go:27 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' flake metadata --json github:NixOS/nixpkgs/nixpkgs-unstable" time=2025-06-03T16:18:45.030Z level=DEBUG source=/Users/runner/work/devbox/devbox/internal/nix/flake.go:27 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' flake metadata --json github:NixOS/nixpkgs/nixpkgs-unstable" cmd.path=/nix/var/nix/profiles/default/bin/nix cmd.stderr="unable to download 'https://api.github.com/repos/NixOS/nixpkgs/commits/nixpkgs-unstable': HTTP error 403" cmd.pid=2817 cmd.code=1 cmd.dur=210.690417ms ``` I think we need to add GITHUB_TOKEN for a couple of jobs that setup Devbox ## How was it tested? will hope that CICD passes ## Community Contribution License All community contributions in this pull request are licensed to the project maintainers under the terms of the [Apache 2 License](https://www.apache.org/licenses/LICENSE-2.0). By creating this pull request, I represent that I have the right to license the contributions to the project maintainers under the Apache 2 License as stated in the [Community Contribution License](https://github.com/jetify-com/opensource/blob/main/CONTRIBUTING.md#community-contribution-license).
1 parent 76e6a09 commit a155493

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

.github/workflows/cache-upload.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ env:
2121
DEVBOX_API_TOKEN: ${{ secrets.DEVBOX_API_TOKEN }}
2222
DEVBOX_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2323
DEVBOX_DEBUG: 1
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2425

2526
jobs:
2627
upload-cache:

.github/workflows/cli-tests.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,15 @@ defaults:
3939
shell: bash
4040

4141
env:
42-
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
DEVBOX_DEBUG: 1
4343
DEVBOX_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4446
HOMEBREW_NO_ANALYTICS: 1
4547
HOMEBREW_NO_AUTO_UPDATE: 1
4648
HOMEBREW_NO_EMOJI: 1
4749
HOMEBREW_NO_ENV_HINTS: 1
4850
HOMEBREW_NO_INSTALL_CLEANUP: 1
49-
DEVBOX_DEBUG: 1
5051

5152
jobs:
5253
build-devbox:

internal/plugin/github_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ func TestGithubPluginAuth(t *testing.T) {
117117
expectedURL := "https://raw.githubusercontent.com/jetpack-io/devbox-plugins/master/test"
118118

119119
t.Run("generate request for public Github repository", func(t *testing.T) {
120+
t.Setenv("GITHUB_TOKEN", "")
120121
url, err := githubPlugin.url("test")
121122
assert.NoError(t, err)
122123
actual, err := githubPlugin.request(url)

0 commit comments

Comments
 (0)