Skip to content

Commit

Permalink
feat: add use-prerelease params
Browse files Browse the repository at this point in the history
  • Loading branch information
keroxp committed Jul 11, 2024
1 parent f2833fb commit 14d0811
Show file tree
Hide file tree
Showing 8 changed files with 7,589 additions and 5,023 deletions.
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# actions-setup-cage

Github Actions to setup [canarycage](https://github.com/loilo-inc/canarycage)

## Usage
Expand All @@ -16,17 +17,26 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
```
## Cage Version
By default, if no `cage-version` specified in step parameters, the latest version of cage will be resolved and installed automatically. **This is highly recommended.**

If you need to set specified version of cage, add `cage-version` param.

```yaml
- uses: loilo-inc/actions-setup-cage@{version}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
cage-version: 3.4.2
- uses: loilo-inc/actions-setup-cage@{version}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
cage-version: 3.4.2
```

## Use Prerelease version

If you want to use prerelease (RC) version of cage, add `use-prerelease` param.

```yaml
- uses: loilo-inc/actions-setup-cage@{version}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
use-prerelease: true
```
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ inputs:
cage-version:
description: "Canarycage version. If no version specified, the latest version will be used automatically."
required: false
use-prelerease:
description: "Whether to use the latest pre-release (RC) version."
required: false
runs:
using: "node20"
main: "lib/index.js"
3 changes: 2 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ function assertInput(name: string): string {
async function main() {
try {
const token = assertInput("github-token");
const usePreRelease = core.getInput("use-pre-release") === "true";
let version = core.getInput("cage-version");
const latestVersion = await getLatestVersion(token);
const latestVersion = await getLatestVersion({ token, usePreRelease });
if (!version) {
version = latestVersion;
core.info(`No version specified. Using latest version: ${version}`);
Expand Down
Loading

0 comments on commit 14d0811

Please sign in to comment.