Skip to content

Commit

Permalink
Switch git tag args
Browse files Browse the repository at this point in the history
  • Loading branch information
ncalteen committed Sep 17, 2023
1 parent f041df4 commit 9ee9cd7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
24 changes: 12 additions & 12 deletions __tests__/version.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ describe('version', () => {
return Promise.resolve(0)
}

if (commandLine === 'git tag "main" "v1.2.3-alpha.4"') {
if (commandLine === 'git tag "v1.2.3-alpha.4" "main"') {
// Creating a new tag doesn't write anything
return Promise.resolve(0)
}
Expand Down Expand Up @@ -187,22 +187,22 @@ describe('version', () => {
expect.any(Object)
)
expect(execMock).toHaveBeenCalledWith(
'git tag "main" "v1.2.3-alpha.4"',
'git tag "v1.2.3-alpha.4" "main"',
[],
expect.any(Object)
)
expect(execMock).not.toHaveBeenCalledWith(
'git tag "main" "v1.2.3"',
'git tag "v1.2.3" "main"',
[],
expect.any(Object)
)
expect(execMock).not.toHaveBeenCalledWith(
'git tag "main" "v1.2"',
'git tag "v1.2" "main"',
[],
expect.any(Object)
)
expect(execMock).not.toHaveBeenCalledWith(
'git tag "main" "v1"',
'git tag "v1" "main"',
[],
expect.any(Object)
)
Expand Down Expand Up @@ -318,7 +318,7 @@ describe('version', () => {
return Promise.resolve(0)
}

if (commandLine === 'git tag "main" "v1.2.3-alpha.4"') {
if (commandLine === 'git tag "v1.2.3-alpha.4" "main"') {
return Promise.resolve(0)
}

Expand Down Expand Up @@ -388,15 +388,15 @@ describe('version', () => {
return Promise.resolve(0)
}

if (commandLine === 'git tag "main" "v1.2.3"') {
if (commandLine === 'git tag "v1.2.3" "main"') {
// Creating a new tag doesn't write anything
return Promise.resolve(0)
}
if (commandLine === 'git tag "main" "v1.2"') {
if (commandLine === 'git tag "v1.2" "main"') {
// Creating a new tag doesn't write anything
return Promise.resolve(0)
}
if (commandLine === 'git tag "main" "v1"') {
if (commandLine === 'git tag "v1" "main"') {
// Creating a new tag doesn't write anything
return Promise.resolve(0)
}
Expand Down Expand Up @@ -449,17 +449,17 @@ describe('version', () => {
expect.any(Object)
)
expect(execMock).toHaveBeenCalledWith(
'git tag "main" "v1.2.3"',
'git tag "v1.2.3" "main"',
[],
expect.any(Object)
)
expect(execMock).toHaveBeenCalledWith(
'git tag "main" "v1.2"',
'git tag "v1.2" "main"',
[],
expect.any(Object)
)
expect(execMock).toHaveBeenCalledWith(
'git tag "main" "v1"',
'git tag "v1" "main"',
[],
expect.any(Object)
)
Expand Down
2 changes: 1 addition & 1 deletion 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.

2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export class Version {
core.info(`Creating tag locally: ${tag}`)
tagOptions.reset()

await exec(`git tag "${ref}" "${tag}"`, [], tagOptions.options)
await exec(`git tag "${tag}" "${ref}"`, [], tagOptions.options)

core.debug(`STDOUT: ${tagOptions.stdout}`)
core.debug(`STDERR: ${tagOptions.stderr}`)
Expand Down

0 comments on commit 9ee9cd7

Please sign in to comment.