-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move cache save to runs.post and exit early (#60)
- Loading branch information
1 parent
1294405
commit 0f37bd8
Showing
6 changed files
with
139 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { saveCache } from "@actions/cache"; | ||
import { getState, warning } from "@actions/core"; | ||
import { CacheState } from "./action"; | ||
|
||
(async () => { | ||
const state: CacheState = JSON.parse(getState("cache")); | ||
if (state.cacheEnabled && !state.cacheHit) { | ||
try { | ||
await saveCache([state.bunPath], state.url); | ||
process.exit(0); | ||
} catch (error) { | ||
warning("Failed to save Bun to cache."); | ||
} | ||
} | ||
})(); |