Skip to content

Commit

Permalink
add dry-run info to afterShipIt hook
Browse files Browse the repository at this point in the history
  • Loading branch information
hipstersmoothie committed Nov 18, 2020
1 parent 861412c commit fd96fc7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/pages/docs/plugins/release-lifecycle-hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ Ran after the `shipit` command has run.
- `newVersion` - The new version that was release
- `commits` - the commits in the release
- `context` - The type of release that was created (`latest`, `next`, `canary`, or `old`)
- `dryRun` - Whether the run is a dry run

```ts
auto.hooks.afterShipIt.tap("MyPlugin", async ({ context }) => {
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/auto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export interface IAutoHooks {
/** Ran after the `shipit` command has run. */
afterShipIt: AsyncParallelHook<
[
{
DryRunOption & {
/** The version published in the shipit run */
newVersion: string | undefined;
/** The commits the version was published for */
Expand Down Expand Up @@ -1532,6 +1532,7 @@ export default class Auto {
newVersion,
commitsInRelease,
context,
dryRun: args.dryRun,
});
}

Expand Down
4 changes: 2 additions & 2 deletions plugins/gradle/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ export default class GradleReleasePluginPlugin implements IPlugin {
]);
});

auto.hooks.afterShipIt.tapPromise(this.name, async () => {
if (!this.snapshotRelease) {
auto.hooks.afterShipIt.tapPromise(this.name, async ({ dryRun }) => {
if (!this.snapshotRelease || dryRun) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions plugins/maven/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ export default class MavenPlugin implements IPlugin {
]);
});

auto.hooks.afterShipIt.tapPromise(this.name, async () => {
if (!this.snapshotRelease) {
auto.hooks.afterShipIt.tapPromise(this.name, async ({ dryRun }) => {
if (!this.snapshotRelease || dryRun) {
return;
}

Expand Down

0 comments on commit fd96fc7

Please sign in to comment.