Skip to content

Commit

Permalink
fixup! fix(ng-dev/pr): add timeout to wait before commenting on pr merge
Browse files Browse the repository at this point in the history
  • Loading branch information
josephperrott committed Feb 23, 2023
1 parent c424a5c commit d4d05e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/local-actions/branch-manager/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -70128,7 +70128,7 @@ var AutosquashMergeStrategy = class extends MergeStrategy {
this.pushTargetBranchesUpstream(targetBranches);
const localBranch = this.getLocalTargetBranchName(githubTargetBranch);
const sha = this.git.run(["rev-parse", localBranch]).stdout.trim();
await new Promise((resolve) => setTimeout(resolve, 5e3));
await new Promise((resolve) => setTimeout(resolve, parseInt(process.env["AUTOSQUASH_TIMEOUT"] || "0")));
await this.git.github.issues.createComment({
...this.git.remoteParams,
issue_number: pullRequest.prNumber,
Expand Down
4 changes: 3 additions & 1 deletion ng-dev/pr/merge/strategies/autosquash-merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ export class AutosquashMergeStrategy extends MergeStrategy {
/** The SHA of the commit pushed to github which represents closing the PR. */
const sha = this.git.run(['rev-parse', localBranch]).stdout.trim();
// Wait five seconds to account for rate limiting of the token usage during merge.
await new Promise((resolve) => setTimeout(resolve, 5000));
await new Promise((resolve) =>
setTimeout(resolve, parseInt(process.env['AUTOSQUASH_TIMEOUT'] || '0')),
);
// Github automatically closes PRs whose commits are merged into the main branch on Github.
// However, it does not note them as merged using the purple merge badge as occurs when done via
// the UI. To inform users that the PR was in fact merged, add a comment expressing the fact
Expand Down

0 comments on commit d4d05e2

Please sign in to comment.