From 1004e78dc8491ff33e94a029700ac0fd6e431dc5 Mon Sep 17 00:00:00 2001 From: Koen Van Looveren Date: Tue, 28 Nov 2023 08:55:21 +0100 Subject: [PATCH] fix: remote git repo fix to have push permission --- index.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 0f22f2e..96471ab 100644 --- a/index.js +++ b/index.js @@ -72,9 +72,6 @@ async function run() { // Setting up Git await runInWorkspace('git', ['config', 'user.name', `"${process.env.GITHUB_USER || 'Dart Conventional Release'}"`]) await runInWorkspace('git', ['config', 'user.email', `"${process.env.GITHUB_EMAIL || 'gh_action_dart_conventional_release@users.noreply.github.com'}"`]) - const remoteGitRepoUrl = `https://${githubToken}:x-oauth-basic@github.com/${process.env.GITHUB_REPOSITORY}.git` - await runInWorkspace('git', ['remote', 'set-url', 'origin', remoteGitRepoUrl]) - // Committing changes await runInWorkspace('git', ['add', 'pubspec.yaml']) @@ -84,8 +81,9 @@ async function run() { await runInWorkspace('git', ['tag', tag]) // Pushing changes - await runInWorkspace('git', ['push', 'origin']) - await runInWorkspace('git', ['push', 'origin', '--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 uploadDartProject() } catch (error) { core.setFailed(`Action failed with error: ${error}`)