diff --git a/pr-sync/action.yml b/pr-sync/action.yml index ba8d95f..b6074ad 100644 --- a/pr-sync/action.yml +++ b/pr-sync/action.yml @@ -22,6 +22,9 @@ inputs: owning-teams: description: A comma separated list of team IDs that can be assigned PRs required: false + auto-assign: + description: Should do automatic assignment of PRs to team members (defaults to true) + required: false outputs: {} runs: using: node16 diff --git a/pr-sync/index.ts b/pr-sync/index.ts index c93f802..9628544 100644 --- a/pr-sync/index.ts +++ b/pr-sync/index.ts @@ -24,6 +24,8 @@ async function main() { const excludedUsers = core.getInput('excluded-users', { required: false }); const owningTeams = core.getInput('owning-teams', { required: false }); const token = core.getInput('github-token', { required: true }); + const shouldAutoAssign = + core.getInput('auto-assign', { required: false }) ?? true; const userClient = github.getOctokit(token); const client = createAppClient(); @@ -51,15 +53,20 @@ async function main() { owningTeam, }; - await Promise.all([ + const actions = [ syncProjectBoard(client, commonOptions, mkLog('sync-project-board')), - randomAssign(client, commonOptions, mkLog('random-assign')), approveRenovatePRs( userClient, commonOptions, mkLog('approve-renovate-prs'), ), - ]); + ]; + + if (shouldAutoAssign) { + actions.push(randomAssign(client, commonOptions, mkLog('random-assign'))); + } + + await Promise.all(actions); } main().catch(error => {