Test with local action
This commit is contained in:
committed by
pullfrog[bot]
parent
6bd4097992
commit
410aecc010
@@ -4,17 +4,14 @@
|
|||||||
* simple check that GITHUB_TOKEN env var exists
|
* simple check that GITHUB_TOKEN env var exists
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as core from "@actions/core";
|
const token = process.env.GITHUB_TOKEN;
|
||||||
|
|
||||||
async function run(): Promise<void> {
|
if (token) {
|
||||||
const token = process.env.GITHUB_TOKEN;
|
console.log(`GITHUB_TOKEN exists`);
|
||||||
|
console.log(`token prefix: ${token.substring(0, 10)}...`);
|
||||||
if (token) {
|
} else {
|
||||||
core.info(`GITHUB_TOKEN exists`);
|
console.error("GITHUB_TOKEN does not exist");
|
||||||
core.info(`token prefix: ${token.substring(0, 10)}...`);
|
// github actions workflow command to fail the step
|
||||||
} else {
|
console.log("::error::GITHUB_TOKEN does not exist");
|
||||||
core.setFailed("GITHUB_TOKEN does not exist");
|
process.exit(1);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await run();
|
|
||||||
|
|||||||
Reference in New Issue
Block a user