Skip to content

Commit

Permalink
Merge pull request #146 from backstage/blam/make-project-id-options
Browse files Browse the repository at this point in the history
chore: make project ID optional for `pr-sync`
  • Loading branch information
benjdlambert authored Apr 22, 2024
2 parents caa4901 + 556c05c commit af61233
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pr-sync/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pr-sync/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
5 changes: 5 additions & 0 deletions pr-sync/syncProjectBoard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit af61233

Please sign in to comment.