Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cache-restore-only input #362

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion __tests__/setup-go.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ describe('setup-go', () => {
await main.run();

expect(logSpy).toHaveBeenCalledWith(`Setup go version spec 1.13.0`);
});
}, 60000);

it('evaluates to stable with no input', async () => {
inputs['go-version'] = '1.13.0';
Expand Down
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