Skip to content

Commit

Permalink
Fix buildChangeSet to look at the ref branch
Browse files Browse the repository at this point in the history
  • Loading branch information
dgellow committed Aug 29, 2023
1 parent ff73f59 commit 3c9d5d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/bin/release-please.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ const createReleasePullRequestCommand: yargs.CommandModule<
logger.debug('updates:', pullRequest.updates.length);
const changes = await github.buildChangeSet(
pullRequest.updates,
targetBranch
manifest.changesBranch
);
for (const update of pullRequest.updates) {
logger.debug(
Expand Down
8 changes: 4 additions & 4 deletions src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ export class GitHub {
updates: Update[],
options?: CreatePullRequestOptions
): Promise<PullRequest> => {
const changes = await this.buildChangeSet(updates, baseBranch);
const changes = await this.buildChangeSet(updates, refBranch);

// create release branch
const pullRequestBranchSha = await this.forkBranch(
Expand Down Expand Up @@ -1414,20 +1414,20 @@ export class GitHub {
* Given a set of proposed updates, build a changeset to suggest.
*
* @param {Update[]} updates The proposed updates
* @param {string} baseBranch The branch to compare against
* @param {string} refBranch The branch where changed file are located
* @return {Changes} The changeset to suggest.
* @throws {GitHubAPIError} on an API error
*/
async buildChangeSet(
updates: Update[],
baseBranch: string
refBranch: string
): Promise<ChangeSet> {
const changes = new Map();
for (const update of updates) {
let content: GitHubFileContents | undefined;
this.logger.debug(`update.path: ${update.path}`);
try {
content = await this.getFileContentsOnBranch(update.path, baseBranch);
content = await this.getFileContentsOnBranch(update.path, refBranch);
} catch (err) {
if (!(err instanceof FileNotFoundError)) throw err;
// if the file is missing and create = false, just continue
Expand Down

0 comments on commit 3c9d5d1

Please sign in to comment.