Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: process label was causing PRs to be closed #358

Merged
merged 2 commits into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 1 addition & 2 deletions __snapshots__/java-yoshi.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,7 @@ This PR was generated with [Release Please](https://github.com/googleapis/releas

exports['labels'] = {
"labels": [
"autorelease: pending",
"type: process"
"autorelease: pending"
]
}

Expand Down
11 changes: 9 additions & 2 deletions src/release-pr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export interface ReleaseCandidate {
previousTag?: string;
}

const DEFAULT_LABELS = 'autorelease: pending,type: process';
const DEFAULT_LABELS = 'autorelease: pending';

export class ReleasePR {
apiUrl: string;
Expand Down Expand Up @@ -127,7 +127,10 @@ export class ReleasePR {
if (includePackageName && !pr.title.includes(` ${this.packageName} `)) {
continue;
}
checkpoint(`closing pull #${pr.number}`, CheckpointType.Failure);
checkpoint(
`closing pull #${pr.number} on ${this.repoUrl}`,
CheckpointType.Failure
);
await this.gh.closePR(pr.number);
}
}
Expand Down Expand Up @@ -225,6 +228,10 @@ export class ReleasePR {
// a return of -1 indicates that PR was not updated.
if (pr > 0) {
await this.gh.addLabels(this.labels, pr);
checkpoint(
`${this.repoUrl} find stale PRs with label "${this.labels.join(',')}"`,
CheckpointType.Success
);
await this.closeStaleReleasePRs(pr, includePackageName);
}
}
Expand Down