(earlyExit?: boolean)
| 15 | |
| 16 | // Added early exit to resolve issue with slow post action step: |
| 17 | export async function run(earlyExit?: boolean) { |
| 18 | try { |
| 19 | const cacheLock = core.getState(State.CachePackageManager); |
| 20 | |
| 21 | if (cacheLock) { |
| 22 | await cachePackages(cacheLock); |
| 23 | |
| 24 | if (earlyExit) { |
| 25 | process.exit(0); |
| 26 | } |
| 27 | } else { |
| 28 | core.debug(`Caching for '${cacheLock}' is not supported`); |
| 29 | } |
| 30 | } catch (error) { |
| 31 | core.setFailed((error as Error).message); |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | const cachePackages = async (packageManager: string) => { |
| 36 | const state = core.getState(State.CacheMatchedKey); |
no test coverage detected