-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost.js
27 lines (23 loc) · 1.03 KB
/
post.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const core = require('@actions/core');
const cache = require('@actions/cache');
async function run() {
try {
const gradleDistributionCacheKeyToSave = core.getState('gradleDistributionCacheKeyToSave');
if (gradleDistributionCacheKeyToSave) {
const gradleDistributionCachePaths = ['~/.gradle/wrapper/dists']
await cache.saveCache(gradleDistributionCachePaths, gradleDistributionCacheKeyToSave);
} else {
core.info('cache hit for gradle-distribution, not saving cache.')
}
const gradleDependenciesCacheKeyToSave = core.getState('gradleDependenciesCacheKeyToSave');
if (gradleDependenciesCacheKeyToSave) {
const gradleDependenciesCachePaths = ['~/.gradle/caches/modules-2']
await cache.saveCache(gradleDependenciesCachePaths, gradleDependenciesCacheKeyToSave);
} else {
core.info('cache hit for gradle dependencies, not saving cache.')
}
} catch (error) {
core.setFailed(error.message);
}
}
run()