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

chore: added ability to opt out of auto assignment #115

Merged
merged 1 commit into from
Feb 8, 2023
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
3 changes: 3 additions & 0 deletions pr-sync/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 10 additions & 3 deletions pr-sync/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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 => {
Expand Down