Skip to content

Commit

Permalink
fix: prevent open release PRs from being mistaken as current releases
Browse files Browse the repository at this point in the history
  • Loading branch information
stdavis committed Aug 15, 2024
1 parent f3b87f2 commit 1c1e48b
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 1 deletion.
29 changes: 29 additions & 0 deletions __snapshots__/github.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ export class GitHub {
number: pullRequest.number,
baseBranchName: pullRequest.baseRefName,
headBranchName: pullRequest.headRefName,
mergeCommitOid: pullRequest.mergeCommit?.oid,
title: pullRequest.title,
body: pullRequest.body,
labels: pullRequest.labels.nodes.map(node => node.name),
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,7 @@ async function latestReleaseVersion(
for await (const commitWithPullRequest of generator) {
commitShas.add(commitWithPullRequest.sha);
const mergedPullRequest = commitWithPullRequest.pullRequest;
if (!mergedPullRequest) {
if (!mergedPullRequest?.mergeCommitOid) {
logger.trace(
`skipping commit: ${commitWithPullRequest.sha} missing merged pull request`
);
Expand Down
1 change: 1 addition & 0 deletions src/pull-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface PullRequest {
readonly headBranchName: string;
readonly baseBranchName: string;
readonly number: number;
readonly mergeCommitOid?: string;
readonly title: string;
readonly body: string;
readonly labels: string[];
Expand Down
1 change: 1 addition & 0 deletions test/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,7 @@ describe('Manifest', () => {
title: 'chore: release 1.2.3',
headBranchName: 'release-please/branches/main',
baseBranchName: 'main',
mergeCommitOid: 'abc123',
number: 123,
body: '',
labels: [],
Expand Down

0 comments on commit 1c1e48b

Please sign in to comment.