Skip to content

Commit

Permalink
Merge pull request #16 from ok-nick/testing
Browse files Browse the repository at this point in the history
Allow boolean `cache` input and document inputs
  • Loading branch information
ok-nick committed Dec 30, 2023
2 parents 7514e5c + bb3a375 commit e2f8ac4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
test-cache:
uses: ./.github/workflows/env.yml
with:
cache: "true"
cache: true
test-no-cache:
uses: ./.github/workflows/env.yml
with:
cache: "false"
cache: false
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,30 @@ For more advanced cases, use the parameters below.
steps:
- uses: ok-nick/setup-aftman@v0.4.2
with:
version: v1.0.0 # name of git tag in aftman (uses latest by default)
path: some_dir/my_project # path to project dir containing `aftman.toml` (uses current dir by default)
cache: "false" # whether to enable binary caching between runs (false by default)
token: ${{ github.token }} # GitHub token to bypass rate limit (passed by default)
version: v1.0.0 # name of git tag in aftman (uses latest tag by default)
path: some_dir/my_project # path to project dir containing `aftman.toml` ("." (current dir) by default)
cache: false # whether to enable binary caching between runs (false by default)
token: ${{ github.token }} # GitHub token to bypass rate limit (${{ github.token }} set by default)
```

## Inputs
### `version`
The git tag of `aftman` to install from releases and use. By default this input will be assigned to the latest version of `aftman`.

### `path`
The path to the directory containing the `aftman.toml` to install tools from. The default is the current directory (`.`).

### `cache`
Enable to cache tools installed by `aftman`, the default value of this input is `false`. Note, in many cases enabling this feature will slow down the `setup-aftman` action.

There are a few reasons you may choose to enable caching:
* Action runs often, causing the GitHub rate-limit to be reached
* A large amount of tools to install
* Server downloading from is slow

### `token`
Set to a GitHub token to be used by `aftman` to increase the GitHub rate-limit. Note, these two options, `${{ github.token }}` and `${ secrets.GITHUB_TOKEN}`, are equivalent and passed by default. **Thus, you do not need to specify this parameter unless you are using a token different from the owner of the repository.**

## Credits
[@nezuo](https://github.com/nezuo) - Installing `aftman` using `gh`

2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ runs:
shell: bash

- name: Cache binaries
if: ${{ inputs.cache == 'true' }}
if: ${{ inputs.cache == true || inputs.cache == 'true' }}
uses: actions/cache@v3
with:
path: |
Expand Down

0 comments on commit e2f8ac4

Please sign in to comment.