Skip to content

Commit

Permalink
fix post-if usage (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
glehmann authored Sep 1, 2023
1 parent a727219 commit be3fe0c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ It is also possible to use [act](https://github.com/nektos/act) to test the cont
The action can be configured with the following arguments:

- `version` - The version of earthly to install. Default is `latest`. Accepts semver style values.
- `github-token` (optional) - Token used to query earthly versions.
- `prerelease` (optional) - allow prerelease versions.
- `use-cache` (optional) - whether to use the cache to store earthly or not.
- `github-token` (optional) - GitHub token for fetching earthly version list. Recommended to avoid GitHub API ratelimit.
1 change: 0 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ runs:
using: node16
main: dist/setup/index.js
post: "dist/cache-save/index.js"
post-if: inputs.use-cache == 'true'
4 changes: 4 additions & 0 deletions dist/cache-save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62434,6 +62434,10 @@ const cacheBinary = () => __awaiter(void 0, void 0, void 0, function* () {
if (!utils.isCacheFeatureAvailable()) {
return;
}
if (core.getInput('use-cache') !== "true") {
core.info(`skipping cache save as use-cache is not true`);
return;
}
const state = core.getState(constants_1.State.CacheMatchedKey);
const primaryKey = core.getState(constants_1.State.CachePrimaryKey);
const path = core.getState(constants_1.State.BinaryPath);
Expand Down
2 changes: 1 addition & 1 deletion dist/cache-save/index.js.map

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions src/cache-save.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ export const cacheBinary = async () => {
return;
}

if (core.getInput('use-cache') !== "true") {
core.info(`skipping cache save as use-cache is not true`);
return;
}

const state = core.getState(State.CacheMatchedKey);
const primaryKey = core.getState(State.CachePrimaryKey);
const path = core.getState(State.BinaryPath);
Expand Down

0 comments on commit be3fe0c

Please sign in to comment.