From 3d5c68b770f0de52ff623c8c34c50d08a519ef8e Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 24 Mar 2026 21:08:41 +0000 Subject: [PATCH] Move the failed workflow re-running to a central `workflow_run` triggered workflow. --- .github/workflows/coding-standards.yml | 32 ---------- .github/workflows/end-to-end-tests.yml | 31 --------- .github/workflows/failed-workflow.yml | 64 ++++++++++++------- .github/workflows/install-testing.yml | 32 ---------- .github/workflows/javascript-tests.yml | 32 ---------- .../workflows/javascript-type-checking.yml | 32 ---------- .../workflows/local-docker-environment.yml | 32 ---------- .github/workflows/performance.yml | 32 ---------- .github/workflows/php-compatibility.yml | 32 ---------- .github/workflows/phpstan-static-analysis.yml | 32 ---------- .github/workflows/phpunit-tests.yml | 32 ---------- .../workflows/test-and-zip-default-themes.yml | 32 ---------- .github/workflows/test-build-processes.yml | 32 ---------- .github/workflows/test-coverage.yml | 32 ---------- .github/workflows/upgrade-develop-testing.yml | 32 ---------- .github/workflows/upgrade-testing.yml | 32 ---------- .github/workflows/workflow-lint.yml | 32 ---------- 17 files changed, 42 insertions(+), 533 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 6f9fc831df92f..a77b0df8717f2 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -81,35 +81,3 @@ jobs: SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - failed-workflow: - name: Failed workflow tasks - runs-on: ubuntu-24.04 - permissions: - actions: write - needs: [ phpcs, jshint, slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - contains( needs.*.result, 'cancelled' ) || - contains( needs.*.result, 'failure' ) - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'failed-workflow.yml', - ref: 'trunk', - inputs: { - run_id: `${context.runId}`, - } - }); diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index b397a2241947e..c2ea5040d8fa5 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -88,34 +88,3 @@ jobs: SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - failed-workflow: - name: Failed workflow tasks - runs-on: ubuntu-24.04 - permissions: - actions: write - needs: [ e2e-tests, slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - contains( needs.*.result, 'cancelled' ) || - contains( needs.*.result, 'failure' ) - ) - steps: - - name: Dispatch workflow run - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'failed-workflow.yml', - ref: 'trunk', - inputs: { - run_id: `${context.runId}`, - } - }); diff --git a/.github/workflows/failed-workflow.yml b/.github/workflows/failed-workflow.yml index 6df8999464a68..df0649c2cbbc5 100644 --- a/.github/workflows/failed-workflow.yml +++ b/.github/workflows/failed-workflow.yml @@ -3,13 +3,39 @@ ## name: Failed Workflow -on: - workflow_dispatch: - inputs: - run_id: - description: 'ID of the GitHub Action workflow run to rerun' - required: true - type: 'string' +# `workflow_run` workflows run on the default branch with the secrets and token +# permissions from the default branch of the target repo, not from the branch or +# fork of the workflow run that triggered the event. +# +# The `workflow_run` trigger is safe in this context because: +# +# - Pull request events are excluded by the job-level `if` condition, preventing +# fork-based privilege escalation. +# - Permissions are tightly constrained (`permissions: {}`), with only `actions: write` +# granted at the job level. +# - No artifacts are consumed and no user-controlled data is interpolated into +# the script. Only workflow run metadata (run_attempt, conclusion, id) is read. +on: # zizmor: ignore[dangerous-triggers] + workflow_run: + workflows: + - "Code Coverage Report" + - "Coding Standards" + - "End-to-end Tests" + - "Installation Tests" + - "JavaScript Tests" + - "JavaScript Type Checking" + - "Lint GitHub Actions workflow files" + - "Local Docker Environment" + - "Performance Tests" + - "PHP Compatibility" + - "PHPStan Static Analysis" + - "PHPUnit Tests" + - "Test Build Processes" + - "Test Default Themes & Create ZIPs" + - "Upgrade Develop Version Tests" + - "Upgrade Tests" + types: + - completed # Disable permissions for all available scopes by default. # Any needed permissions should be configured at the job level. @@ -19,7 +45,6 @@ jobs: # Attempts to rerun a workflow. # # Performs the following steps: - # - Retrieves the workflow run that dispatched this workflow. # - Restarts all failed jobs when the workflow fails or is cancelled for the first time. failed-workflow: name: Rerun a workflow @@ -27,6 +52,14 @@ jobs: permissions: actions: write timeout-minutes: 30 + if: | + github.repository == 'WordPress/wordpress-develop' && + github.event.workflow_run.event != 'pull_request' && + github.event.workflow_run.run_attempt < 2 && + ( + github.event.workflow_run.conclusion == 'failure' || + github.event.workflow_run.conclusion == 'cancelled' + ) steps: - name: Rerun a workflow @@ -35,22 +68,9 @@ jobs: retries: 15 retry-exempt-status-codes: 418 script: | - const workflow_run = await github.rest.actions.getWorkflowRun({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: process.env.RUN_ID, - }); - - // Only rerun after the first run attempt. - if ( workflow_run.data.run_attempt > 1 ) { - return; - } - const rerun = await github.rest.actions.reRunWorkflowFailedJobs({ owner: context.repo.owner, repo: context.repo.repo, - run_id: process.env.RUN_ID, + run_id: context.payload.workflow_run.id, enable_debug_logging: true }); - env: - RUN_ID: ${{ inputs.run_id }} diff --git a/.github/workflows/install-testing.yml b/.github/workflows/install-testing.yml index f15d6e4830268..51040110480ff 100644 --- a/.github/workflows/install-testing.yml +++ b/.github/workflows/install-testing.yml @@ -153,35 +153,3 @@ jobs: SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - failed-workflow: - name: Failed workflow tasks - runs-on: ubuntu-24.04 - permissions: - actions: write - needs: [ slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - contains( needs.*.result, 'cancelled' ) || - contains( needs.*.result, 'failure' ) - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'failed-workflow.yml', - ref: 'trunk', - inputs: { - run_id: `${context.runId}`, - } - }); diff --git a/.github/workflows/javascript-tests.yml b/.github/workflows/javascript-tests.yml index 4ebb1fd17b499..26123599612e0 100644 --- a/.github/workflows/javascript-tests.yml +++ b/.github/workflows/javascript-tests.yml @@ -76,35 +76,3 @@ jobs: SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - failed-workflow: - name: Failed workflow tasks - runs-on: ubuntu-24.04 - permissions: - actions: write - needs: [ slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - contains( needs.*.result, 'cancelled' ) || - contains( needs.*.result, 'failure' ) - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'failed-workflow.yml', - ref: 'trunk', - inputs: { - run_id: `${context.runId}`, - } - }); diff --git a/.github/workflows/javascript-type-checking.yml b/.github/workflows/javascript-type-checking.yml index b8a10da5465bd..c41256e1b938f 100644 --- a/.github/workflows/javascript-type-checking.yml +++ b/.github/workflows/javascript-type-checking.yml @@ -67,35 +67,3 @@ jobs: SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - failed-workflow: - name: Failed workflow tasks - runs-on: ubuntu-24.04 - permissions: - actions: write - needs: [ slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - contains( needs.*.result, 'cancelled' ) || - contains( needs.*.result, 'failure' ) - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'failed-workflow.yml', - ref: 'trunk', - inputs: { - run_id: `${context.runId}`, - } - }); diff --git a/.github/workflows/local-docker-environment.yml b/.github/workflows/local-docker-environment.yml index c9dbae312595a..1b65156ffe8b4 100644 --- a/.github/workflows/local-docker-environment.yml +++ b/.github/workflows/local-docker-environment.yml @@ -136,35 +136,3 @@ jobs: SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - failed-workflow: - name: Failed workflow tasks - runs-on: ubuntu-24.04 - permissions: - actions: write - needs: [ build-test-matrix, environment-tests-mysql, slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - contains( needs.*.result, 'cancelled' ) || - contains( needs.*.result, 'failure' ) - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'failed-workflow.yml', - ref: 'trunk', - inputs: { - run_id: `${context.runId}`, - } - }); diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index d9be2c8842ec4..5a5d146f42079 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -150,35 +150,3 @@ jobs: SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - failed-workflow: - name: Failed workflow tasks - runs-on: ubuntu-24.04 - permissions: - actions: write - needs: [ slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - contains( needs.*.result, 'cancelled' ) || - contains( needs.*.result, 'failure' ) - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'failed-workflow.yml', - ref: 'trunk', - inputs: { - run_id: `${context.runId}`, - } - }); diff --git a/.github/workflows/php-compatibility.yml b/.github/workflows/php-compatibility.yml index bd81c8958daa6..ed60ef6545a2c 100644 --- a/.github/workflows/php-compatibility.yml +++ b/.github/workflows/php-compatibility.yml @@ -65,35 +65,3 @@ jobs: SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - failed-workflow: - name: Failed workflow tasks - runs-on: ubuntu-24.04 - permissions: - actions: write - needs: [ slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - contains( needs.*.result, 'cancelled' ) || - contains( needs.*.result, 'failure' ) - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'failed-workflow.yml', - ref: 'trunk', - inputs: { - run_id: `${context.runId}`, - } - }); diff --git a/.github/workflows/phpstan-static-analysis.yml b/.github/workflows/phpstan-static-analysis.yml index a479e8e371214..6311be683efaa 100644 --- a/.github/workflows/phpstan-static-analysis.yml +++ b/.github/workflows/phpstan-static-analysis.yml @@ -63,35 +63,3 @@ jobs: SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - failed-workflow: - name: Failed workflow tasks - runs-on: ubuntu-24.04 - permissions: - actions: write - needs: [ slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - contains( needs.*.result, 'cancelled' ) || - contains( needs.*.result, 'failure' ) - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'failed-workflow.yml', - ref: 'trunk', - inputs: { - run_id: `${context.runId}`, - } - }); diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index de36d5a505187..6bcb0c925ee3d 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -329,35 +329,3 @@ jobs: SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - failed-workflow: - name: Failed workflow tasks - runs-on: ubuntu-24.04 - permissions: - actions: write - needs: [ slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - contains( needs.*.result, 'cancelled' ) || - contains( needs.*.result, 'failure' ) - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'failed-workflow.yml', - ref: 'trunk', - inputs: { - run_id: `${context.runId}`, - } - }); diff --git a/.github/workflows/test-and-zip-default-themes.yml b/.github/workflows/test-and-zip-default-themes.yml index 6ea0f7f206809..a4883022a3327 100644 --- a/.github/workflows/test-and-zip-default-themes.yml +++ b/.github/workflows/test-and-zip-default-themes.yml @@ -271,35 +271,3 @@ jobs: SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - failed-workflow: - name: Failed workflow tasks - runs-on: ubuntu-24.04 - permissions: - actions: write - needs: [ slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - contains( needs.*.result, 'cancelled' ) || - contains( needs.*.result, 'failure' ) - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'failed-workflow.yml', - ref: 'trunk', - inputs: { - run_id: `${context.runId}`, - } - }); diff --git a/.github/workflows/test-build-processes.yml b/.github/workflows/test-build-processes.yml index 184f85a323993..82b35e4eda1fe 100644 --- a/.github/workflows/test-build-processes.yml +++ b/.github/workflows/test-build-processes.yml @@ -115,35 +115,3 @@ jobs: SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - failed-workflow: - name: Failed workflow tasks - runs-on: ubuntu-24.04 - permissions: - actions: write - needs: [ slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - contains( needs.*.result, 'cancelled' ) || - contains( needs.*.result, 'failure' ) - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'failed-workflow.yml', - ref: 'trunk', - inputs: { - run_id: `${context.runId}`, - } - }); diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml index deb190eba9e9b..30db4f8904084 100644 --- a/.github/workflows/test-coverage.yml +++ b/.github/workflows/test-coverage.yml @@ -81,35 +81,3 @@ jobs: SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - failed-workflow: - name: Failed workflow tasks - runs-on: ubuntu-24.04 - permissions: - actions: write - needs: [ slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - contains( needs.*.result, 'cancelled' ) || - contains( needs.*.result, 'failure' ) - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'failed-workflow.yml', - ref: 'trunk', - inputs: { - run_id: `${context.runId}`, - } - }); diff --git a/.github/workflows/upgrade-develop-testing.yml b/.github/workflows/upgrade-develop-testing.yml index 2b00536adeb66..1dc0e59225684 100644 --- a/.github/workflows/upgrade-develop-testing.yml +++ b/.github/workflows/upgrade-develop-testing.yml @@ -128,35 +128,3 @@ jobs: SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - failed-workflow: - name: Failed workflow tasks - runs-on: ubuntu-24.04 - permissions: - actions: write - needs: [ slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - contains( needs.*.result, 'cancelled' ) || - contains( needs.*.result, 'failure' ) - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'failed-workflow.yml', - ref: 'trunk', - inputs: { - run_id: `${context.runId}`, - } - }); diff --git a/.github/workflows/upgrade-testing.yml b/.github/workflows/upgrade-testing.yml index f042131bd7c26..1353c937e33f4 100644 --- a/.github/workflows/upgrade-testing.yml +++ b/.github/workflows/upgrade-testing.yml @@ -207,35 +207,3 @@ jobs: SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - failed-workflow: - name: Failed workflow tasks - runs-on: ubuntu-24.04 - permissions: - actions: write - needs: [ slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - contains( needs.*.result, 'cancelled' ) || - contains( needs.*.result, 'failure' ) - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'failed-workflow.yml', - ref: 'trunk', - inputs: { - run_id: `${context.runId}`, - } - }); diff --git a/.github/workflows/workflow-lint.yml b/.github/workflows/workflow-lint.yml index 0aae098543e21..87ff2b87a9116 100644 --- a/.github/workflows/workflow-lint.yml +++ b/.github/workflows/workflow-lint.yml @@ -55,35 +55,3 @@ jobs: SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - failed-workflow: - name: Failed workflow tasks - runs-on: ubuntu-24.04 - permissions: - actions: write - needs: [ slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - contains( needs.*.result, 'cancelled' ) || - contains( needs.*.result, 'failure' ) - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'failed-workflow.yml', - ref: 'trunk', - inputs: { - run_id: `${context.runId}`, - } - });