diff --git a/src/cdk-cli-integ-tests.ts b/src/cdk-cli-integ-tests.ts index 6cebe99..5a5fcb2 100644 --- a/src/cdk-cli-integ-tests.ts +++ b/src/cdk-cli-integ-tests.ts @@ -1,5 +1,7 @@ import { Component, github, javascript } from 'projen'; +const NOT_FLAGGED_EXPR = "!contains(github.event.pull_request.labels.*.name, 'pr/exempt-integ-test')"; + export interface CdkCliIntegTestsWorkflowProps { /** * Runners for the workflow @@ -113,7 +115,7 @@ export class CdkCliIntegTestsWorkflow extends Component { }, // Don't run again on the merge queue, we already got confirmation that it works and the // tests are quite expensive. - if: "github.event_name != 'merge_group'", + if: `github.event_name != 'merge_group' && ${NOT_FLAGGED_EXPR}`, steps: [ { name: 'Checkout', @@ -215,7 +217,7 @@ export class CdkCliIntegTestsWorkflow extends Component { }, // Don't run again on the merge queue, we already got confirmation that it works and the // tests are quite expensive. - if: "github.event_name != 'merge_group'", + if: `github.event_name != 'merge_group' && ${NOT_FLAGGED_EXPR}`, strategy: { failFast: false, matrix: { diff --git a/test/__snapshots__/cdk-cli-integ-tests.test.ts.snap b/test/__snapshots__/cdk-cli-integ-tests.test.ts.snap index e809e91..3909311 100644 --- a/test/__snapshots__/cdk-cli-integ-tests.test.ts.snap +++ b/test/__snapshots__/cdk-cli-integ-tests.test.ts.snap @@ -168,7 +168,7 @@ jobs: environment: approval env: CI: "true" - if: github.event_name != 'merge_group' + if: github.event_name != 'merge_group' && !contains(github.event.pull_request.labels.*.name, 'pr/exempt-integ-test') steps: - name: Checkout uses: actions/checkout@v4 @@ -207,7 +207,7 @@ jobs: MAVEN_ARGS: --no-transfer-progress IS_CANARY: "true" CI: "true" - if: github.event_name != 'merge_group' + if: github.event_name != 'merge_group' && !contains(github.event.pull_request.labels.*.name, 'pr/exempt-integ-test') steps: - name: Download build artifacts uses: actions/download-artifact@v4