Skip to content

Commit

Permalink
git-plugin: add noPush option
Browse files Browse the repository at this point in the history
this skips the whole push stage for the git plugin
  • Loading branch information
foxriver76 committed Jul 21, 2024
1 parent 4da181d commit 2b5e816
Show file tree
Hide file tree
Showing 3 changed files with 5,051 additions and 8,012 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
Placeholder for the next version (at the beginning of the line):
## **WORK IN PROGRESS**
-->
## **WORK IN PROGRESS**
* `git` plugin: allow to skip push stage via `noPush` option

## 3.7.3 (2024-07-05)
* `package` plugin: Support monorepos managed with Yarn v4

Expand Down
10 changes: 10 additions & 0 deletions packages/plugin-git/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ class GitPlugin implements Plugin {
description: "Only push the annotated tag, not the release commit",
default: false,
},
noPush: {
type: "boolean",
description: "Do not push the commit or tag to Git",
default: false,
},
});
}

Expand Down Expand Up @@ -183,6 +188,11 @@ ${context.getData("changelog_new")}`;
}

private async executePushStage(context: Context): Promise<void> {
if (context.argv.noPush) {
context.cli.log("Do not push to git");
return;
}

const upstream =
(context.argv.remote as string | undefined) || (await getUpstream(context));
const [remote, branch] = upstream.split("/", 2);
Expand Down
Loading

0 comments on commit 2b5e816

Please sign in to comment.