Connectors: Add connector registry for extensibility #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PHPStan Static Analysis | |
| on: | |
| # PHPStan testing was introduced in 7.0.0. | |
| push: | |
| branches: | |
| - trunk | |
| - '[7-9].[0-9]' | |
| tags: | |
| - '[7-9].[0-9]' | |
| - '[7-9]+.[0-9].[0-9]+' | |
| pull_request: | |
| branches: | |
| - trunk | |
| - '[7-9].[0-9]' | |
| paths: | |
| # This workflow only scans PHP files. | |
| - '**.php' | |
| # These files configure Composer. Changes could affect the outcome. | |
| - 'composer.*' | |
| # These files configure PHPStan. Changes could affect the outcome. | |
| - 'phpstan.neon.dist' | |
| - 'tests/phpstan/base.neon' | |
| - 'tests/phpstan/baseline.php' | |
| # Confirm any changes to relevant workflow files. | |
| - '.github/workflows/phpstan-static-analysis.yml' | |
| - '.github/workflows/reusable-phpstan-static-analysis-v1.yml' | |
| workflow_dispatch: | |
| # 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' && github.head_ref || github.sha }} | |
| cancel-in-progress: true | |
| # Disable permissions for all available scopes by default. | |
| # Any needed permissions should be configured at the job level. | |
| permissions: {} | |
| jobs: | |
| # Runs PHPStan Static Analysis. | |
| phpstan: | |
| name: PHP static analysis | |
| uses: ./.github/workflows/reusable-phpstan-static-analysis-v1.yml | |
| permissions: | |
| contents: read | |
| if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} | |
| slack-notifications: | |
| name: Slack Notifications | |
| uses: ./.github/workflows/slack-notifications.yml | |
| permissions: | |
| actions: read | |
| contents: read | |
| needs: [ phpstan ] | |
| 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' }} | |
| secrets: | |
| SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} | |
| SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }} | |
| 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}`, | |
| } | |
| }); |