Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .github/local-actions/branch-manager/main.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions ng-dev/pr/merge/strategies/autosquash-merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@ export class AutosquashMergeStrategy extends MergeStrategy {
pull_number: pullRequest.prNumber,
state: 'closed',
});

// When a pull request is merged, GitHub automatically closes any linked issues.
// This is not the case when the pull request is not merged into the main branch.
// This is why we need to manually close the linked issues.
await this.closeLinkedIssues(pullRequest);
}

// When a pull request is merged, GitHub automatically closes any linked issues.
// This is not the case when the pull request is not merged into the main branch or closed via commit message.
// This is why we need to manually close the linked issues.
await this.closeLinkedIssues(pullRequest);
Comment thread
alan-agius4 marked this conversation as resolved.
}
}

Expand Down
12 changes: 1 addition & 11 deletions ng-dev/pr/merge/strategies/strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,18 +246,8 @@ export abstract class MergeStrategy {
* because the PR's target branch is *not* the repository's main branch.
*
* It updates any open linked issues to a `closed` state with a `completed` reason.
*
* @note The method is a **no-op** if the PR target is the main branch,
* as GitHub handles issue closure automatically in that case.
*/
protected async closeLinkedIssues({
closingIssuesReferences,
githubTargetBranch,
}: PullRequest): Promise<void> {
if (githubTargetBranch === this.git.mainBranchName) {
return;
}

protected async closeLinkedIssues({closingIssuesReferences}: PullRequest): Promise<void> {
for (const {number: issue_number, state} of closingIssuesReferences) {
if (state === 'CLOSED') {
Comment thread
alan-agius4 marked this conversation as resolved.
continue;
Expand Down
Loading