Skip to content

Commit

Permalink
Add cache-restore-only input
Browse files Browse the repository at this point in the history
  • Loading branch information
dsame committed Apr 3, 2023
1 parent 41c2024 commit aef6ecc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ inputs:
default: true
cache-dependency-path:
description: 'Used to specify the path to a dependency file - go.sum'
cache-restore-only:
description: 'Set this option to true if you do not want to modify the cache from the previous build'
default: false
architecture:
description: 'Target architecture for Go to use. Examples: x86, x64. Will use system architecture by default.'
outputs:
Expand Down
3 changes: 2 additions & 1 deletion dist/cache-save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60363,7 +60363,8 @@ function run() {
exports.run = run;
const cachePackages = () => __awaiter(void 0, void 0, void 0, function* () {
const cacheInput = core.getBooleanInput('cache');
if (!cacheInput) {
const cacheRestoreOnly = core.getBooleanInput('cache-restore-only');
if (!cacheInput || cacheRestoreOnly) {
return;
}
const packageManager = 'default';
Expand Down
3 changes: 2 additions & 1 deletion src/cache-save.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export async function run() {

const cachePackages = async () => {
const cacheInput = core.getBooleanInput('cache');
if (!cacheInput) {
const cacheRestoreOnly = core.getBooleanInput('cache-restore-only');
if (!cacheInput || cacheRestoreOnly) {
return;
}

Expand Down

0 comments on commit aef6ecc

Please sign in to comment.