diff --git a/.github/workflows/pull-request-lint.yml b/.github/workflows/pull-request-lint.yml index 2af8ddd29..3863acae6 100644 --- a/.github/workflows/pull-request-lint.yml +++ b/.github/workflows/pull-request-lint.yml @@ -32,8 +32,11 @@ jobs: docs revert scopes: |- + aws-cdk cdk-assets + cdk-cli-wrapper cli + cli-integ cli-lib-alpha cli-plugin-contract cloud-assembly-schema @@ -43,7 +46,10 @@ jobs: docs integ-runner integ-testing + node-bundle toolkit-lib + toolkit-lib + yarn-cling requireScope: false contributorStatement: name: Require Contributor Statement diff --git a/.projenrc.ts b/.projenrc.ts index 486159e9e..5216bc823 100644 --- a/.projenrc.ts +++ b/.projenrc.ts @@ -232,20 +232,7 @@ const repoProject = new yarn.Monorepo({ }, semanticTitleOptions: { types: ['feat', 'fix', 'chore', 'refactor', 'test', 'docs', 'revert'], - scopes: [ - 'cdk-assets', - 'cli', - 'cli-lib-alpha', - 'cli-plugin-contract', - 'cloud-assembly-schema', - 'cloudformation-diff', - 'deps', - 'dev-deps', - 'docs', - 'integ-runner', - 'integ-testing', - 'toolkit-lib', - ], + scopes: [], // actually set at the bottom of the file to be based on monorepo packages }, }, }, @@ -1736,4 +1723,24 @@ new LargePrChecker(repo, { ((repo.github?.tryFindWorkflow('integ')?.getJob('prepare') as Job | undefined)?.env ?? {}).DEBUG = 'true'; +// Set allowed scopes based on monorepo packages +const disallowed = new Set([ + 'cdk', // use aws-cdk or cli + 'user-input-gen', // use cli +]); +repoProject.github?.tryFindWorkflow('pull-request-lint')?.file?.patch( + pj.JsonPatch.replace('/jobs/validate/steps/0/with/scopes', [ + 'cli', + 'deps', + 'dev-deps', + 'docs', + 'integ-testing', + 'toolkit-lib', + ...repoProject.subprojects + .filter(p => p instanceof yarn.TypeScriptWorkspace) + .map(p => p.name) + .map(n => n.split('/').pop()), + ].filter(s => s && !disallowed.has(s)).sort().join('\n')), +); + repo.synth();