-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
48 additions
and
6 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
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 |
---|---|---|
@@ -1,15 +1,24 @@ | ||
const core = require("@actions/core"); | ||
|
||
async function main() { | ||
// Find the current time since the UNIX epoch. | ||
const stamp = Date.now(); | ||
core.info(`Creating timestamp at ${new Date(stamp)}. All files in the \`target\` folder not accessed between now and the end of the run will be purged.`); | ||
|
||
core.info(`Creating timestamp at ${new Date(stamp)}.`); | ||
core.info("All files in the `target` folder not accessed between now and the end of the run will be purged.") | ||
|
||
// Save the timestamp so that it can be accessed in the post step. | ||
core.saveState("timestamp", stamp); | ||
} | ||
|
||
try { | ||
main(); | ||
|
||
core.saveState("failed", "false"); | ||
} catch (err) { | ||
core.setFailed(`Action failed with error: ${err}`); | ||
|
||
// The post action will, by default, always run. This signals that an error occurred and it | ||
// should not proceed. | ||
core.saveState("failed", "true"); | ||
} |
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