diff --git a/check-github-token/action.yml b/check-github-token/action.yml new file mode 100644 index 0000000..23350b5 --- /dev/null +++ b/check-github-token/action.yml @@ -0,0 +1,7 @@ +name: "Check GitHub Token" +description: "Check if GITHUB_TOKEN environment variable exists" +author: "Pullfrog" + +runs: + using: "node24" + main: "entry.ts" diff --git a/check-github-token/entry.ts b/check-github-token/entry.ts new file mode 100644 index 0000000..69f068f --- /dev/null +++ b/check-github-token/entry.ts @@ -0,0 +1,20 @@ +#!/usr/bin/env node + +/** + * simple check that GITHUB_TOKEN env var exists + */ + +import * as core from "@actions/core"; + +async function run(): Promise { + const token = process.env.GITHUB_TOKEN; + + if (token) { + core.info(`GITHUB_TOKEN exists`); + core.info(`token prefix: ${token.substring(0, 10)}...`); + } else { + core.setFailed("GITHUB_TOKEN does not exist"); + } +} + +await run();