mirror of
https://github.com/actions/setup-java.git
synced 2025-04-21 10:26:46 +00:00
Add validation for post step (#3)
* work on fixing cache post step * fix tests
This commit is contained in:
parent
5f3f74c689
commit
53f73ba16b
6 changed files with 31 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
|||
import * as core from '@actions/core';
|
||||
import * as gpg from './gpg';
|
||||
import * as constants from './constants';
|
||||
import { isJobStatusSuccess } from './util';
|
||||
import { save } from './cache';
|
||||
|
||||
async function removePrivateKeyFromKeychain() {
|
||||
|
@ -20,8 +21,9 @@ async function removePrivateKeyFromKeychain() {
|
|||
* @returns Promise that will be resolved when the save process finishes
|
||||
*/
|
||||
async function saveCache() {
|
||||
const jobStatus = isJobStatusSuccess();
|
||||
const cache = core.getInput(constants.INPUT_CACHE);
|
||||
return cache ? save(cache) : Promise.resolve();
|
||||
return jobStatus && cache ? save(cache) : Promise.resolve();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -69,3 +69,9 @@ export function getToolcachePath(toolName: string, version: string, architecture
|
|||
|
||||
return null;
|
||||
}
|
||||
|
||||
export function isJobStatusSuccess() {
|
||||
const jobStatus = core.getInput('job-status');
|
||||
|
||||
return jobStatus === 'success';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue