Skip to content

Commit 395dc8e

Browse files
committed
add prefix to notices and warnings about cache status
1 parent 8cee2a5 commit 395dc8e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

main.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ const tc = require("@actions/tool-cache")
66
const ch = require("@actions/cache")
77
const fsp = require("fs").promises
88

9+
const notice = (msg) => core.notice(`gh-actions-lua: ${msg}`)
10+
const warning = (msg) => core.warning(`gh-actions-lua: ${msg}`)
11+
912
const path = require("path")
1013

1114
const INSTALL_PREFIX = ".install"
@@ -157,19 +160,19 @@ async function main() {
157160
if (core.getInput('buildCache') == 'true') {
158161
const restoredCache = await ch.restoreCache([luaInstallPath], cacheKey)
159162
if (restoredCache) {
160-
core.notice(`Cache restored: ${restoredCache}`)
163+
notice(`Cache restored: ${restoredCache}`)
161164
} else {
162-
core.notice(`No cache available, clean build`)
165+
notice(`No cache available, clean build`)
163166
}
164167
}
165168

166169
if (!(await exists(luaInstallPath))) {
167170
await install(luaInstallPath, luaVersion)
168171
try {
169-
core.notice(`Storing into cache: ${cacheKey}`)
172+
notice(`Storing into cache: ${cacheKey}`)
170173
await ch.saveCache([luaInstallPath], cacheKey)
171174
} catch (e) {
172-
core.warning(`Failed to save to cache (continuing anyway): ${e}`)
175+
warning(`Failed to save to cache (continuing anyway): ${e}`)
173176
}
174177
}
175178

0 commit comments

Comments
 (0)