Skip to content

Commit

Permalink
Push tag only
Browse files Browse the repository at this point in the history
  • Loading branch information
kpgalligan committed Apr 10, 2024
1 parent c4708ac commit 5299cf0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export async function run(): Promise<void> {

const git = simpleGit()

await git.pull()

await git.checkoutLocalBranch(branchName)

const diff = await git.diffSummary()
Expand All @@ -25,7 +27,7 @@ export async function run(): Promise<void> {
}

await git.addAnnotatedTag(tagVersion, tagMessage)
await git.raw('push', 'origin', '-u', branchName, '--follow-tags')
await git.raw('push', 'origin', '-f', `refs/tags/${branchName}`)
} catch (error) {
// Fail the workflow run if an error occurs
if (error instanceof Error) core.setFailed(error.message)
Expand Down

0 comments on commit 5299cf0

Please sign in to comment.