Skip to content

Commit

Permalink
fix(prepare): fix wrong comparison url in the PR summary when getTagN…
Browse files Browse the repository at this point in the history
…ame is overridden in ship.config.js (#753)

* fix(prepare): fix wrong comparison url in the PR summary when getTagName is overridden in ship.config.js

* fix: test case

Co-authored-by: shipjs <shipjs@test.com>
  • Loading branch information
Eunjae Lee and shipjs authored Apr 3, 2020
1 parent 754d40d commit 4a40920
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ describe('defaultConfig', () => {
const baseBranch = 'master';
const stagingBranch = 'releases/v0.1.1';
const currentVersion = '0.1.0';
const currentTag = 'v0.1.0';
const nextVersion = '0.1.1';

it('gets message for same branch strategy', () => {
Expand All @@ -57,6 +58,7 @@ describe('defaultConfig', () => {
destinationBranch,
mergeStrategy,
currentVersion,
currentTag,
nextVersion,
publishCommandInStr,
});
Expand Down
3 changes: 2 additions & 1 deletion packages/shipjs-lib/src/lib/config/defaultConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default {
destinationBranch,
mergeStrategy,
currentVersion,
currentTag,
nextVersion,
releaseType,
publishCommandInStr,
Expand All @@ -45,7 +46,7 @@ export default {
`- Merge: \`${stagingBranch}\` → \`${destinationBranch}\``,
...(mergeStrategy.toSameBranch.includes(baseBranch)
? [
`- [Compare the changes between the versions](${repoURL}/compare/v${currentVersion}...${stagingBranch})`,
`- [Compare the changes between the versions](${repoURL}/compare/${currentTag}...${stagingBranch})`,
`> :warning: When merging this pull request, you need to **_"Squash and merge"_** and make sure the title starts with \`${pullRequestTitle}\`.`,
`> After that, a commit \`${pullRequestTitle}\` will be added and \`shipjs trigger\` will be able to trigger the release based on the commit.`,
`> Fore more information, please refer to the mergeStrategy section of the [guide](https://community.algolia.com/shipjs/guide/useful-config.html#mergestrategy).`,
Expand Down
1 change: 1 addition & 0 deletions packages/shipjs/src/flow/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ async function prepare({
baseBranch,
stagingBranch,
currentVersion,
currentTag,
nextVersion,
releaseType,
noBrowse,
Expand Down
2 changes: 2 additions & 0 deletions packages/shipjs/src/step/prepare/createPullRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default async ({
baseBranch,
stagingBranch,
currentVersion,
currentTag,
nextVersion,
releaseType,
noBrowse,
Expand Down Expand Up @@ -76,6 +77,7 @@ export default async ({
destinationBranch,
mergeStrategy,
currentVersion,
currentTag,
nextVersion,
releaseType,
publishCommandInStr,
Expand Down

0 comments on commit 4a40920

Please sign in to comment.