Skip to content

Commit 25d8e2e

Browse files
Merge pull request #5 from LucaTools/github-enterprise-token-support
Add github_token input to support GitHub Enterprise
2 parents f9a4642 + 1c92868 commit 25d8e2e

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@ This action is also published on the [GitHub Actions Marketplace](https://github
3333
spec: Lucafile
3434
```
3535
36+
### GitHub Enterprise
37+
38+
On GitHub Enterprise the built-in `github.token` is scoped to your enterprise instance and cannot authenticate against the github.com API. Pass a github.com Personal Access Token to avoid rate limiting:
39+
40+
```yaml
41+
- uses: LucaTools/setup-luca@v1
42+
with:
43+
spec: Lucafile
44+
github_token: ${{ secrets.GH_COM_TOKEN }}
45+
```
46+
3647
---
3748

3849
## Inputs
@@ -41,6 +52,7 @@ This action is also published on the [GitHub Actions Marketplace](https://github
4152
|-------|-------------|----------|---------|
4253
| `version` | Luca version to install (e.g. `"1.2.3"`). Omit to use the latest release. | No | `""` (latest) |
4354
| `spec` | Path to the Luca spec file, relative to the workspace root. Omit to skip tool installation. | No | `""` (skip) |
55+
| `github_token` | GitHub token for authenticating against the github.com API when downloading the Luca CLI. Defaults to the built-in `github.token`, which works on github.com. On GitHub Enterprise, pass a github.com PAT to avoid API rate limiting. | No | `""` (uses `github.token`) |
4456

4557
When `spec` is provided, all tools listed in the spec file are added to `PATH` and available by name in subsequent steps.
4658

action.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ inputs:
2121
are installed and added to PATH. Omit to skip tool installation.
2222
required: false
2323
default: ""
24+
github_token:
25+
description: >
26+
A GitHub token used to authenticate against the github.com API when
27+
downloading the Luca CLI. Defaults to the built-in `github.token`,
28+
which works on github.com. When running on GitHub Enterprise, pass a
29+
github.com Personal Access Token here to avoid API rate limiting.
30+
required: false
31+
default: ""
2432

2533
runs:
2634
using: composite
@@ -33,7 +41,7 @@ runs:
3341
- name: Install Luca CLI
3442
shell: bash
3543
env:
36-
GITHUB_TOKEN: ${{ github.token }}
44+
GITHUB_TOKEN: ${{ inputs.github_token || github.token }}
3745
run: curl -fsSL https://luca.tools/install.sh | bash
3846

3947
- name: Install tools

0 commit comments

Comments
 (0)