Skip to content

Commit 9257c59

Browse files
committed
fix: fix nanoid usage
1 parent 7e7f911 commit 9257c59

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ import {context, GitHub} from "@actions/github"
66
import chalk from "chalk"
77
import getBooleanActionInput from "get-boolean-action-input"
88
import isGitRepoDirty from "is-git-repo-dirty"
9-
import { nanoid } from "nanoid"
9+
import { customAlphabet } from "nanoid"
1010
import resolveAny from "resolve-any"
1111
import zahl from "zahl"
1212

13+
const nanoid = customAlphabet("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", 8)
14+
1315
/**
1416
* @typedef {Object} Options
1517
* @prop {*} commitMessage If a function is given, it will be called as `async function(commitManager)`
@@ -96,7 +98,7 @@ export default class CommitManager {
9698
if (this.branch) {
9799
return
98100
}
99-
const branchId = nanoid("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", 8)
101+
const branchId = nanoid()
100102
const branchPrefix = await resolveAny(this.options.branchPrefix, this)
101103
this.branch = `${branchPrefix}${branchId}`
102104
await exec("git", ["config", "user.email", "action@github.com"])

0 commit comments

Comments
 (0)