Skip to content

Commit

Permalink
Remove the need for specifying GITHUB_TOKEN env (#18)
Browse files Browse the repository at this point in the history
Signed-off-by: peterdeme <snypox@gmail.com>
  • Loading branch information
peterdeme authored Feb 21, 2024
1 parent d058696 commit f67ebcc
Show file tree
Hide file tree
Showing 7 changed files with 513 additions and 24,540 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,8 @@ jobs:
- name: Checkout
uses: actions/checkout@main

- name: Install packages
run: npm ci

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

- name: Test if spacectl works
run: spacectl --version
17 changes: 7 additions & 10 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 }}
uses: spacelift-io/setup-spacectl@v1

- name: Deploy infrastructure
env:
Expand All @@ -28,18 +26,17 @@ You can optionally provide a specific version:
```yaml
steps:
- name: Install spacectl
uses: spacelift-io/setup-spacectl@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: spacelift-io/setup-spacectl@v1
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: false
default: ${{ github.token }}

runs:
using: node20
Expand Down
Loading

0 comments on commit f67ebcc

Please sign in to comment.