diff --git a/lib/main.js b/lib/main.js index f7ca378..9742cae 100644 --- a/lib/main.js +++ b/lib/main.js @@ -28,12 +28,14 @@ async function run() { core.debug(` Detected version ${pkg.version}`) if (!process.env.hasOwnProperty('INPUT_GITHUB_TOKEN') || process.env.INPUT_GITHUB_TOKEN.trim().length === 0) { - core.setFailed('Invalid or missing GITHUB_TOKEN.') - return + if (!process.env.hasOwnProperty('GITHUB_TOKEN')) { + core.setFailed('Invalid or missing GITHUB_TOKEN.') + return + } } // Check for existing tag - const git = new github.GitHub(process.env.INPUT_GITHUB_TOKEN) + const git = new github.GitHub(process.env.INPUT_GITHUB_TOKEN || process.env.GITHUB_TOKEN) const owner = process.env.GITHUB_ACTOR const repo = process.env.GITHUB_REPOSITORY.split('/').pop()