Skip to content

Commit

Permalink
fix: disable github tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
vanlooverenkoen committed Nov 30, 2023
1 parent 7949578 commit 9571afa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
12 changes: 6 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
32 changes: 17 additions & 15 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ================================
Expand Down Expand Up @@ -86,9 +86,11 @@ async function run() {
await runInWorkspace('git', ['tag', tag])

// Pushing changes
const remoteGitRepoUrl = `https://${githubToken}:[email protected]/${process.env.GITHUB_REPOSITORY}.git`
await runInWorkspace('git', ['push', remoteGitRepoUrl])
await runInWorkspace('git', ['push', remoteGitRepoUrl, '--tags'])
// const remoteGitRepoUrl = `https://${githubToken}:[email protected]/${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}`)
Expand Down

0 comments on commit 9571afa

Please sign in to comment.