Skip to content

Commit e977a5e

Browse files
authored
try this
1 parent 6b53221 commit e977a5e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,25 +70,25 @@ if (exitCode) {
7070
? core.getBooleanInput("push-force")
7171
: null;
7272
if (!pushRefspec) {
73-
const { exitCode } = await $({
73+
const { exitCode, stdout } = await $({
7474
cwd: rootPath,
7575
reject: false,
7676
})`git symbolic-ref HEAD`;
7777
if (exitCode) {
78-
pushRefspec = stdout;
79-
} else {
8078
const { stdout } = await $({ cwd: rootPath })`git tag --points-at HEAD`;
79+
console.assert(stdout, "no stdout from listing tags");
8180
const tags = stdout.split(/\r?\n/g);
82-
console.assert(tags.length === 1, `tags=${tags} longer than 1`);
81+
console.assert(tags.length >= 1, `tags=${tags} longer than 1`);
8382
pushRefspec = tags[0];
83+
} else {
84+
pushRefspec = stdout;
8485
}
8586
}
8687
if (pushForce == null) {
8788
const { exitCode } = await $({
8889
cwd: rootPath,
8990
reject: false,
9091
})`git symbolic-ref HEAD`;
91-
console.log(pushForce, "git symbolic-ref HEAD", exitCode);
9292
if (exitCode) {
9393
pushForce = true;
9494
} else {

0 commit comments

Comments
 (0)