diff --git a/pr-sync/action.yml b/pr-sync/action.yml index b6074ad..7aeb979 100644 --- a/pr-sync/action.yml +++ b/pr-sync/action.yml @@ -15,7 +15,7 @@ inputs: required: true project-id: description: The ID of the project board to sync PRs towards - required: true + required: false excluded-users: description: A comma separated list of usernames of users that should not be assigned PRs required: false diff --git a/pr-sync/index.ts b/pr-sync/index.ts index 35d263c..3e83359 100644 --- a/pr-sync/index.ts +++ b/pr-sync/index.ts @@ -20,7 +20,7 @@ async function main() { `PR sync #${issueNumber} ${eventName}/${action} actor=${actor} author=${author}`, ); - const projectId = core.getInput('project-id', { required: true }); + const projectId = core.getInput('project-id', { required: false }); const excludedUsers = core.getInput('excluded-users', { required: false }); const owningTeams = core.getInput('owning-teams', { required: false }); const token = core.getInput('github-token', { required: true }); diff --git a/pr-sync/syncProjectBoard.ts b/pr-sync/syncProjectBoard.ts index acd7a6a..9a2cc31 100644 --- a/pr-sync/syncProjectBoard.ts +++ b/pr-sync/syncProjectBoard.ts @@ -30,6 +30,11 @@ export async function syncProjectBoard( options: Options, log = core.info, ) { + if (!options.projectId) { + log('No project ID provided, skipping project board sync'); + return; + } + if (options.eventName === 'pull_request_target') { if (['opened', 'reopened'].includes(options.action!)) { await addToBoard(client, options, log);