From 9571afa31ecfd4d2c89fd2c99db27408f9cb4293 Mon Sep 17 00:00:00 2001 From: Koen Van Looveren Date: Thu, 30 Nov 2023 10:24:50 +0100 Subject: [PATCH] fix: disable github tokens --- action.yml | 12 ++++++------ index.js | 32 +++++++++++++++++--------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/action.yml b/action.yml index 5b15c33..b90c7b7 100644 --- a/action.yml +++ b/action.yml @@ -7,12 +7,12 @@ branding: icon: upload-cloud color: blue inputs: - github-token: - description: 'Github token' - required: true - github-username: - description: 'The Github username that is linked to the github token' - required: true + # github-token: + # description: 'Github token' + # required: true + # github-username: + # description: 'The Github username that is linked to the github token' + # required: true tag-prefix: description: 'Prefix that is used for the git tag' default: 'v' diff --git a/index.js b/index.js index 10ac0d2..0febc71 100644 --- a/index.js +++ b/index.js @@ -22,18 +22,18 @@ if (process.env.PACKAGEJSON_DIR) { const workspace = process.env.GITHUB_WORKSPACE console.log(`Current workspace: ${workspace}`) -// Github Token -const githubToken = core.getInput('github-token') -if (githubToken == null || githubToken == "") { - core.setFailed('github-token not found as input.') - return -} -// Github Username -const githubUsername = core.getInput('github-username') -if (githubUsername == null || githubUsername == "") { - core.setFailed('github-username not found as input.') - return -} +// // Github Token +// const githubToken = core.getInput('github-token') +// if (githubToken == null || githubToken == "") { +// core.setFailed('github-token not found as input.') +// return +// } +// // Github Username +// const githubUsername = core.getInput('github-username') +// if (githubUsername == null || githubUsername == "") { +// core.setFailed('github-username not found as input.') +// return +// } // ===================================================================== // ================================ RUN ================================ @@ -86,9 +86,11 @@ async function run() { await runInWorkspace('git', ['tag', tag]) // Pushing changes - const remoteGitRepoUrl = `https://${githubToken}:x-oauth-basic@github.com/${process.env.GITHUB_REPOSITORY}.git` - await runInWorkspace('git', ['push', remoteGitRepoUrl]) - await runInWorkspace('git', ['push', remoteGitRepoUrl, '--tags']) + // const remoteGitRepoUrl = `https://${githubToken}:x-oauth-basic@github.com/${process.env.GITHUB_REPOSITORY}.git` + // await runInWorkspace('git', ['push', remoteGitRepoUrl]) + // await runInWorkspace('git', ['push', remoteGitRepoUrl, '--tags']) + await runInWorkspace('git', ['push']) + await runInWorkspace('git', ['push', '--tags']) } catch (error) { core.setFailed(`Action failed with error: ${error}`)