Browse Source

fix(ci): use secret GitHub token to avoid rate limiting

We can hit rate limiting when downloading Nix stuff, e.g.:

```
error: Failed to open archive (Source threw exception: error:
        … during download of 'https://api.github.com/repos/numtide/flake-utils/tarball/11707dc2f618dd54ca8739b309ec4fc024de578b'

        error: unable to download 'https://api.github.com/repos/numtide/flake-utils/tarball/11707dc2f618dd54ca8739b309ec4fc024de578b': HTTP error 401

        response body:

        {
          "message": "Bad credentials",
          "documentation_url": "https://docs.github.com/rest",
          "status": "401"
        })
```
ariasuni 2 weeks ago
parent
commit
0bd1f46b6f
1 changed files with 4 additions and 0 deletions
  1. 4 0
      .github/workflows/unit-tests.yml

+ 4 - 0
.github/workflows/unit-tests.yml

@@ -185,6 +185,8 @@ jobs:
         uses: DeterminateSystems/nix-installer-action@v17
       - name: Nix Flake Check
         run: nix build .#checks.${{ matrix.target }}.${{ matrix.checks }} -L
+        env:
+          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   flake-build:
     needs: conventional
     name: Build Nix package
@@ -199,3 +201,5 @@ jobs:
         uses: DeterminateSystems/nix-installer-action@v17
       - name: Nix Build
         run: nix build .#packages.${{ matrix.target }}.default -L
+        env:
+          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}