Skip to content

Commit

Permalink
Remove the need for specifying GITHUB_TOKEN env
Browse files Browse the repository at this point in the history
Signed-off-by: peterdeme <snypox@gmail.com>
  • Loading branch information
peterdeme committed Feb 21, 2024
1 parent d058696 commit 52a95d6
Show file tree
Hide file tree
Showing 7 changed files with 510 additions and 24,534 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ jobs:

- name: Test installing spacectl
run: node .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Test if spacectl works
run: spacectl --version
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ This is a simple GitHub Action to install [spacectl](https://github.com/spacelif

## ✨ Usage

`GITHUB_TOKEN` environment variable is a **must** because we're using it internally to list all releases of `spacectl` to find the latest one.
Note that the action queries the GitHub API to list the available releases of `spacectl` so it needs a GitHub token. By default it uses `${{ github.token }}` but you can override it by setting the `github-token` input.

```yaml
steps:
- name: Install spacectl
uses: spacelift-io/setup-spacectl@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy infrastructure
env:
Expand All @@ -29,17 +27,16 @@ You can optionally provide a specific version:
steps:
- name: Install spacectl
uses: spacelift-io/setup-spacectl@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: v0.18.0
```
### Inputs
| Name | Description | Default |
| --------- | ------------------------------------------------------------------------------------------------------------- | -------- |
| `version` | Which version of `spacectl` to install. If not specified, the latest version will be installed (recommended). | `latest` |
| Name | Description | Default |
| -------------- | ------------------------------------------------------------------------------------------------------------- | --------------------- |
| `version` | Which version of `spacectl` to install. If not specified, the latest version will be installed (recommended). | `latest` |
| `github-token` | The GitHub token to use for querying the GitHub API. | `${{ github.token }}` |

### Outputs

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ inputs:
version:
description: The version of Spacectl to install. Defaults to latest.
default: latest
github-token:
description: GitHub token to use for querying the GitHub API.
required: true
default: ${{ github.token }}

runs:
using: node20
Expand Down
Loading

0 comments on commit 52a95d6

Please sign in to comment.