Skip to content

Commit af61233

Browse files
authored
Merge pull request #146 from backstage/blam/make-project-id-options
chore: make project ID optional for `pr-sync`
2 parents caa4901 + 556c05c commit af61233

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

pr-sync/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ inputs:
1515
required: true
1616
project-id:
1717
description: The ID of the project board to sync PRs towards
18-
required: true
18+
required: false
1919
excluded-users:
2020
description: A comma separated list of usernames of users that should not be assigned PRs
2121
required: false

pr-sync/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async function main() {
2020
`PR sync #${issueNumber} ${eventName}/${action} actor=${actor} author=${author}`,
2121
);
2222

23-
const projectId = core.getInput('project-id', { required: true });
23+
const projectId = core.getInput('project-id', { required: false });
2424
const excludedUsers = core.getInput('excluded-users', { required: false });
2525
const owningTeams = core.getInput('owning-teams', { required: false });
2626
const token = core.getInput('github-token', { required: true });

pr-sync/syncProjectBoard.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ export async function syncProjectBoard(
3030
options: Options,
3131
log = core.info,
3232
) {
33+
if (!options.projectId) {
34+
log('No project ID provided, skipping project board sync');
35+
return;
36+
}
37+
3338
if (options.eventName === 'pull_request_target') {
3439
if (['opened', 'reopened'].includes(options.action!)) {
3540
await addToBoard(client, options, log);

0 commit comments

Comments
 (0)