diff --git a/dev-infra/ng-dev.js b/dev-infra/ng-dev.js index 9a54520696..9a73ddbc31 100755 --- a/dev-infra/ng-dev.js +++ b/dev-infra/ng-dev.js @@ -4215,6 +4215,14 @@ var PullRequestMergeTask = /** @class */ (function () { missing.push('public_repo'); } } + // Pull requests can modify Github action workflow files. In such cases Github requires us to + // push with a token that has the `workflow` oauth scope set. To avoid errors when the + // caretaker intends to merge such PRs, we ensure the scope is always set on the token before + // the merge process starts. + // https://docs.github.com/en/developers/apps/scopes-for-oauth-apps#available-scopes + if (!scopes.includes('workflow')) { + missing.push('workflow'); + } })]; case 1: hasOauthScopes = _c.sent(); diff --git a/dev-infra/pr/merge/task.ts b/dev-infra/pr/merge/task.ts index 9e8724b57f..759bd8b942 100644 --- a/dev-infra/pr/merge/task.ts +++ b/dev-infra/pr/merge/task.ts @@ -74,6 +74,15 @@ export class PullRequestMergeTask { missing.push('public_repo'); } } + + // Pull requests can modify Github action workflow files. In such cases Github requires us to + // push with a token that has the `workflow` oauth scope set. To avoid errors when the + // caretaker intends to merge such PRs, we ensure the scope is always set on the token before + // the merge process starts. + // https://docs.github.com/en/developers/apps/scopes-for-oauth-apps#available-scopes + if (!scopes.includes('workflow')) { + missing.push('workflow'); + } }); if (hasOauthScopes !== true) {