generated from actions/javascript-action
-
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.
Action cleanup state, actions toolkit sync (#33)
- Loading branch information
1 parent
3ddace2
commit 1d0b272
Showing
13 changed files
with
73 additions
and
23 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const fs = require('fs') | ||
const core = require('@actions/core') | ||
|
||
// main cleanup action entrypoint | ||
async function run() { | ||
const secretFile = core.getState('secret_file') | ||
|
||
if (secretFile !== "") { | ||
await fs.access(secretFile, fs.constants.F_OK, (err) => { | ||
if (err) throw err | ||
|
||
fs.unlink(secretFile, (err) => { | ||
if (err) throw err | ||
|
||
core.info(`File "${secretFile}" with a secret was deleted`) | ||
}) | ||
}) | ||
} else { | ||
core.debug('Nothing to clean up') | ||
} | ||
} | ||
|
||
// run the action | ||
(async () => { | ||
await run() | ||
})().catch(error => { | ||
core.setFailed(error.message) | ||
}) |
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