diff --git a/.github/workflows/pull-request-comments.yml b/.github/workflows/pull-request-comments.yml index 5f1c2ef245..b44e9667d0 100644 --- a/.github/workflows/pull-request-comments.yml +++ b/.github/workflows/pull-request-comments.yml @@ -4,19 +4,14 @@ name: Pull Request Comments on: pull_request_target: types: [ 'opened' ] - workflow_dispatch: - inputs: - pr_number: - description: 'The pull request number to process.' - required: true - type: string + branches: + - trunk # Cancels all previous workflow runs for pull requests that have not completed. concurrency: # The concurrency group contains the workflow name and the branch name for pull requests # or the commit hash for any other events. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.event_name == 'workflow_dispatch' && inputs.pr_number || github.sha }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.event_name == 'workflow_dispatch' && github.event.number || github.sha }} # Disable permissions for all available scopes by default. # Any needed permissions should be configured at the job level. @@ -31,7 +26,6 @@ jobs: pull-requests: write timeout-minutes: 5 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'pull_request_target' }} - steps: - uses: wow-actions/welcome@72817eb31cda1de60f51893d80e2e82ce57f7e76 # v1.3.0 with: @@ -87,7 +81,7 @@ jobs: permissions: issues: write pull-requests: write - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'workflow_dispatch' }} + if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'pull_request_target' }} steps: - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 with: @@ -96,7 +90,7 @@ jobs: const commentInfo = { owner: context.repo.owner, repo: context.repo.repo, - issue_number: context.payload.inputs.pr_number + issue_number: ${{ github.event.number }} }; const comments = ( await github.rest.issues.listComments( commentInfo ) ).data; @@ -122,7 +116,7 @@ jobs: For more details about these limitations and more, check out the [Limitations page](https://wordpress.github.io/wordpress-playground/limitations/) in the WordPress Playground documentation. - [Test this pull request with WordPress Playground](https://playground.wordpress.net/wordpress.html?pr=${ context.payload.inputs.pr_number }). + [Test this pull request with WordPress Playground](https://playground.wordpress.net/wordpress.html?pr=${{ github.event.number }}). `; github.rest.issues.createComment( commentInfo ); diff --git a/.github/workflows/test-build-processes.yml b/.github/workflows/test-build-processes.yml index fd32f31014..c6b86acf29 100644 --- a/.github/workflows/test-build-processes.yml +++ b/.github/workflows/test-build-processes.yml @@ -106,32 +106,6 @@ jobs: os: ${{ matrix.os }} directory: ${{ matrix.directory }} - # Calls the Pull Request Commenting workflow to leave a comment detailing how to test the PR within WordPress Playground. - playground-comment: - name: Leave WordPress Playground details - runs-on: ubuntu-latest - permissions: - actions: write - continue-on-error: true - needs: [ test-core-build-process, test-core-build-process-macos, test-gutenberg-build-process, test-gutenberg-build-process-macos ] - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'pull_request' }} - - steps: - - name: Dispatch workflow run - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'pull-request-comments.yml', - ref: 'trunk', - inputs: { - pr_number: '${{ github.event.number }}' - } - }); slack-notifications: name: Slack Notifications @@ -139,7 +113,7 @@ jobs: permissions: actions: read contents: read - needs: [ test-core-build-process, test-core-build-process-macos, test-gutenberg-build-process, test-gutenberg-build-process-macos, playground-comment ] + needs: [ test-core-build-process, test-core-build-process-macos, test-gutenberg-build-process, test-gutenberg-build-process-macos ] if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} with: calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} @@ -154,7 +128,7 @@ jobs: runs-on: ubuntu-latest permissions: actions: write - needs: [ playground-comment ] + needs: [ slack-notifications ] if: | always() && github.repository == 'WordPress/wordpress-develop' &&