mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
Avoid changing HEAD when executing publish (#81)
This commit is contained in:
+8
-8
@@ -22,20 +22,20 @@ export const pullBranch = async (branch: string) => {
|
||||
|
||||
export const push = async (
|
||||
branch: string,
|
||||
{ force, includeTags }: { force?: boolean; includeTags?: boolean } = {}
|
||||
{ force }: { force?: boolean } = {}
|
||||
) => {
|
||||
await exec(
|
||||
"git",
|
||||
[
|
||||
"push",
|
||||
"origin",
|
||||
`HEAD:${branch}`,
|
||||
includeTags && "--tags",
|
||||
force && "--force",
|
||||
].filter<string>(Boolean as any)
|
||||
["push", "origin", `HEAD:${branch}`, force && "--force"].filter<string>(
|
||||
Boolean as any
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
export const pushTags = async () => {
|
||||
await exec("git", ["push", "origin", "--tags"]);
|
||||
};
|
||||
|
||||
export const switchToMaybeExistingBranch = async (branch: string) => {
|
||||
let { stderr } = await execWithOutput("git", ["checkout", branch], {
|
||||
ignoreReturnCode: true,
|
||||
|
||||
Reference in New Issue
Block a user