Skip to content

Commit 9437b4d

Browse files
committed
fix: always use nanoid to be unique
1 parent 3409577 commit 9437b4d

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/index.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,7 @@ export default class CommitManager {
9696
if (this.branch) {
9797
return
9898
}
99-
let branchId
100-
if (context.sha) {
101-
branchId = context.sha.slice(0, 8)
102-
} else {
103-
branchId = nanoid("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", 8)
104-
}
99+
const branchId = nanoid("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", 8)
105100
const branchPrefix = await resolveAny(this.options.branchPrefix, this)
106101
this.branch = `${branchPrefix}${branchId}`
107102
await exec("git", ["config", "user.email", "action@github.com"])
@@ -189,4 +184,4 @@ export default class CommitManager {
189184
}
190185
}
191186

192-
}
187+
}

0 commit comments

Comments
 (0)