Scheduling infrastructure for absolutely everyone.
fix: prevent non-E2E labels from triggering workflow runs (#23459)
Keith Williamse45f9c5a13ae
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.ymlindex e9f983df1a3..fe8eeafd0d5 100644--- a/.github/workflows/pr.yml+++ b/.github/workflows/pr.yml@@ -16,10 +16,14 @@ concurrency:group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}cancel-in-progress: true+env:+ SKIP_WORKFLOW: ${{ github.event.action == 'labeled' && github.event.label.name != 'ready-for-e2e' }}+jobs:changes:name: Detect changesruns-on: buildjet-2vcpu-ubuntu-2204+ if: ${{ env.SKIP_WORKFLOW != 'true' }}permissions:pull-requests: readoutputs:@@ -43,10 +47,11 @@ jobs:needs: [changes]runs-on: buildjet-2vcpu-ubuntu-2204name: Check for E2E label+ if: ${{ env.SKIP_WORKFLOW != 'true' }}permissions:pull-requests: readoutputs:- run-e2e: ${{ steps.check-if-pr-has-label.outputs.run-e2e == 'true' && (github.event.action != 'labeled' || github.event.label.name == 'ready-for-e2e') }}+ run-e2e: ${{ steps.check-if-pr-has-label.outputs.run-e2e == 'true' && env.SKIP_WORKFLOW != 'true' }}steps:- name: Check if PR exists with ready-for-e2e label for this SHAid: check-if-pr-has-label@@ -94,130 +99,131 @@ jobs:deps:name: Install dependenciesneeds: [changes, check-label]- if: ${{ needs.changes.outputs.has-files-requiring-all-checks == 'true' }}+ if: ${{ env.SKIP_WORKFLOW != 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}uses: ./.github/workflows/yarn-install.ymltype-check:name: Type checkneeds: [changes, check-label, deps]- if: ${{ needs.changes.outputs.has-files-requiring-all-checks == 'true' }}+ if: ${{ env.SKIP_WORKFLOW != 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}uses: ./.github/workflows/check-types.ymlsecrets: inheritlint:name: Lintersneeds: [changes, check-label, deps]- if: ${{ needs.changes.outputs.has-files-requiring-all-checks == 'true' }}+ if: ${{ env.SKIP_WORKFLOW != 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}uses: ./.github/workflows/lint.ymlsecrets: inheritunit-test:name: Testsneeds: [changes, check-label, deps]- if: ${{ needs.changes.outputs.has-files-requiring-all-checks == 'true' }}+ if: ${{ env.SKIP_WORKFLOW != 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}uses: ./.github/workflows/unit-tests.ymlsecrets: inheritbuild-api-v1:name: Production buildsneeds: [changes, check-label, deps]- if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}+ if: ${{ env.SKIP_WORKFLOW != 'true' && needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}uses: ./.github/workflows/api-v1-production-build.ymlsecrets: inheritbuild-api-v2:name: Production buildsneeds: [changes, check-label, deps]- if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}+ if: ${{ env.SKIP_WORKFLOW != 'true' && needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}uses: ./.github/workflows/api-v2-production-build.ymlsecrets: inheritbuild-atoms:name: Production buildsneeds: [changes, check-label, deps]- if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}+ if: ${{ env.SKIP_WORKFLOW != 'true' && needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}uses: ./.github/workflows/atoms-production-build.ymlsecrets: inheritbuild-docs:name: Production buildsneeds: [changes, check-label, deps]- if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}+ if: ${{ env.SKIP_WORKFLOW != 'true' && needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}uses: ./.github/workflows/docs-build.ymlsecrets: inheritbuild:name: Production buildsneeds: [changes, check-label, deps]- if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}+ if: ${{ env.SKIP_WORKFLOW != 'true' && needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}uses: ./.github/workflows/production-build-without-database.ymlsecrets: inheritintegration-test:name: Testsneeds: [changes, check-label, build, build-api-v1, build-api-v2]- if: ${{ needs.changes.outputs.has-files-requiring-all-checks == 'true' }}+ if: ${{ env.SKIP_WORKFLOW != 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}uses: ./.github/workflows/integration-tests.ymlsecrets: inherite2e:name: Testsneeds: [changes, check-label, build, build-api-v1, build-api-v2]- if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}+ if: ${{ env.SKIP_WORKFLOW != 'true' && needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}uses: ./.github/workflows/e2e.ymlsecrets: inherite2e-api-v2:name: Testsneeds: [changes, check-label, build, build-api-v1, build-api-v2]- if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}+ if: ${{ env.SKIP_WORKFLOW != 'true' && needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}uses: ./.github/workflows/e2e-api-v2.ymlsecrets: inherite2e-app-store:name: Testsneeds: [changes, check-label, build, build-api-v1, build-api-v2]- if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}+ if: ${{ env.SKIP_WORKFLOW != 'true' && needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}uses: ./.github/workflows/e2e-app-store.ymlsecrets: inherite2e-embed:name: Testsneeds: [changes, check-label, build, build-api-v1, build-api-v2]- if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}+ if: ${{ env.SKIP_WORKFLOW != 'true' && needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}uses: ./.github/workflows/e2e-embed.ymlsecrets: inherite2e-embed-react:name: Testsneeds: [changes, check-label, build, build-api-v1, build-api-v2]- if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}+ if: ${{ env.SKIP_WORKFLOW != 'true' && needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}uses: ./.github/workflows/e2e-embed-react.ymlsecrets: inherite2e-atoms:name: Testsneeds: [changes, check-label, build, build-atoms, build-api-v2]- if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}+ if: ${{ env.SKIP_WORKFLOW != 'true' && needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}uses: ./.github/workflows/e2e-atoms.ymlsecrets: inheritanalyze:name: Analyze Buildneeds: [build]+ if: ${{ env.SKIP_WORKFLOW != 'true' }}uses: ./.github/workflows/nextjs-bundle-analysis.ymlsecrets: inheritmerge-reports:name: Merge reports- if: ${{ !cancelled() && needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}+ if: ${{ !cancelled() && env.SKIP_WORKFLOW != 'true' && needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}needs: [changes, check-label, e2e, e2e-embed, e2e-embed-react, e2e-app-store, e2e-atoms]uses: ./.github/workflows/merge-reports.ymlsecrets: inheritpublish-report:name: Publish HTML report- if: ${{ !cancelled() && needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}+ if: ${{ !cancelled() && env.SKIP_WORKFLOW != 'true' && needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}permissions:contents: writeissues: write@@ -228,7 +234,7 @@ jobs:cleanup-report:name: Cleanup HTML report- if: ${{ !cancelled() && needs.check-label.outputs.run-e2e == 'true' && (github.event.pull_request.merged == true || github.event.pull_request.state == 'closed') }}+ if: ${{ !cancelled() && env.SKIP_WORKFLOW != 'true' && needs.check-label.outputs.run-e2e == 'true' && (github.event.pull_request.merged == true || github.event.pull_request.state == 'closed') }}permissions:contents: writeissues: write@@ -262,5 +268,5 @@ jobs:runs-on: buildjet-2vcpu-ubuntu-2204steps:- name: fail if conditional jobs failed- if: needs.changes.outputs.has-files-requiring-all-checks == 'true' && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled'))+ if: env.SKIP_WORKFLOW != 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled'))run: exit 1