Changeset 51921
- Timestamp:
- 10/20/2021 02:40:47 PM (20 months ago)
- Location:
- trunk/.github/workflows
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.github/workflows/coding-standards.yml
r51535 r51921 147 147 - name: Ensure version-controlled files are not modified or deleted 148 148 run: git diff --exit-code 149 150 slack-notifications: 151 name: Slack Notifications 152 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@master 153 needs: [ phpcs, jshint ] 154 if: ${{ always() }} -
trunk/.github/workflows/end-to-end-tests.yml
r51535 r51921 117 117 - name: Ensure version-controlled files are not modified or deleted 118 118 run: git diff --exit-code 119 120 slack-notifications: 121 name: Slack Notifications 122 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@master 123 needs: [ e2e-tests ] 124 if: ${{ always() }} -
trunk/.github/workflows/javascript-tests.yml
r51535 r51921 86 86 - name: Ensure version-controlled files are not modified or deleted 87 87 run: git diff --exit-code 88 89 slack-notifications: 90 name: Slack Notifications 91 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@master 92 needs: [ test-js ] 93 if: ${{ always() }} -
trunk/.github/workflows/php-compatibility.yml
r51535 r51921 88 88 - name: Ensure version-controlled files are not modified or deleted 89 89 run: git diff --exit-code 90 91 slack-notifications: 92 name: Slack Notifications 93 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@master 94 needs: [ php-compatibility ] 95 if: ${{ always() }} -
trunk/.github/workflows/phpunit-tests.yml
r51890 r51921 243 243 WPT_REPORT_API_KEY: "${{ secrets.WPT_REPORT_API_KEY }}" 244 244 run: docker-compose run --rm -e WPT_REPORT_API_KEY -e WPT_PREPARE_DIR=/var/www -e WPT_TEST_DIR=/var/www php php test-runner/report.php 245 246 slack-notifications: 247 name: Slack Notifications 248 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@master 249 needs: [ test-php ] 250 if: ${{ always() }} -
trunk/.github/workflows/slack-notifications.yml
r51709 r51921 1 1 ## 2 # Posts messages to the Making WordPress Core Slack Instance by 3 # submitting data to Slack webhook URLs received by Slack Workflows. 2 # A reusable workflow for posting messages to the Making WordPress 3 # Core Slack Instance by submitting data to Slack webhook URLs 4 # received by Slack Workflows. 4 5 ## 5 6 name: Slack Notifications 6 7 7 8 on: 8 workflow_run: 9 workflows: 10 - Code Coverage Report 11 - Coding Standards 12 - End-to-end Tests 13 - JavaScript Tests 14 - PHP Compatibility 15 - PHPUnit Tests 16 - Test NPM 17 - Test old branches 18 types: 19 - completed 20 branches: 21 - master 22 - trunk 23 - '[3-9].[0-9]' 9 workflow_call: 24 10 25 11 jobs: … … 42 28 43 29 steps: 30 - name: Get the workflow ID 31 id: current-workflow-id 32 uses: actions/github-script@441359b1a30438de65712c2fbca0abe4816fa667 # v5.0.0 33 with: 34 script: | 35 const workflow_run = await github.actions.getWorkflowRun({ 36 owner: '${{ github.repository_owner }}', 37 repo: 'wordpress-develop', 38 run_id: ${{ github.run_id }}, 39 }); 40 return workflow_run.data.workflow_id; 41 42 - name: Get the workflow URL 43 id: current-workflow-url 44 uses: actions/github-script@441359b1a30438de65712c2fbca0abe4816fa667 # v5.0.0 45 with: 46 script: | 47 const workflow_run = await github.actions.getWorkflowRun({ 48 owner: '${{ github.repository_owner }}', 49 repo: 'wordpress-develop', 50 run_id: ${{ github.run_id }}, 51 }); 52 return workflow_run.data.html_url; 53 44 54 - name: Get details about the previous workflow run 45 55 id: previous-result 46 uses: actions/github-script@ a3e7071a34d7e1f219a8a4de9a5e0a34d1ee1293 # v4.0.256 uses: actions/github-script@441359b1a30438de65712c2fbca0abe4816fa667 # v5.0.0 47 57 with: 48 58 script: | 49 const workflow_runs = await github.actions.listWorkflowRuns({50 owner: context.repo.owner,51 repo: context.repo.repo,52 workflow_id: ${{ github.event.workflow_run.workflow_id}},53 branch: '${{ github. event.workflow_run.head_branch}}',59 const previous_runs = await github.actions.listWorkflowRuns({ 60 owner: '${{ github.repository_owner }}', 61 repo: 'wordpress-develop', 62 workflow_id: ${{ steps.current-workflow-id.outputs.result }}, 63 branch: '${{ github.ref_name }}', 54 64 per_page: 1, 55 65 page: 2, 56 66 }); 57 return workflow_runs.data.workflow_runs[0].conclusion;67 return previous_runs.data.workflow_runs[0].conclusion; 58 68 59 69 - name: Store previous conclusion as an output … … 65 75 run: | 66 76 COMMIT_MESSAGE=$(cat <<'EOF' | awk 'NR==1' | sed 's/`/\\`/g' | sed 's/\"/\\\\"/g' 67 ${{ github.event. workflow_run.head_commit.message }}77 ${{ github.event.head_commit.message }} 68 78 EOF 69 79 ) … … 72 82 - name: Construct payload and store as an output 73 83 id: create-payload 74 run: echo "::set-output name=payload::{\"workflow_name\":\"${{ github. event.workflow_run.name }}\",\"ref_name\":\"${{ github.event.workflow_run.head_branch }}\",\"run_url\":\"${{ github.event.workflow_run.html_url}}\",\"commit_message\":\"${{ steps.commit-message.outputs.commit_message_escaped }}\"}"84 run: echo "::set-output name=payload::{\"workflow_name\":\"${{ github.workflow }}\",\"ref_name\":\"${{ github.ref_name }}\",\"run_url\":\"${{ steps.current-workflow-url.outputs.result }}\",\"commit_message\":\"${{ steps.commit-message.outputs.commit_message_escaped }}\"}" 75 85 76 86 # Posts notifications when a workflow fails. … … 79 89 runs-on: ubuntu-latest 80 90 needs: [ prepare ] 81 if: ${{ github.event.workflow_run.conclusion == 'failure'}}91 if: ${{ failure() }} 82 92 83 93 steps: … … 94 104 runs-on: ubuntu-latest 95 105 needs: [ prepare ] 96 if: ${{ needs.prepare.outputs.previous_conclusion == 'failure' && github.event.workflow_run.conclusion == 'success'}}106 if: ${{ needs.prepare.outputs.previous_conclusion == 'failure' && success() }} 97 107 98 108 steps: … … 109 119 runs-on: ubuntu-latest 110 120 needs: [ prepare ] 111 if: ${{ github.event.workflow_run.conclusion == 'success'}}121 if: ${{ success() }} 112 122 113 123 steps: … … 124 134 runs-on: ubuntu-latest 125 135 needs: [ prepare ] 126 if: ${{ github.event.workflow_run.conclusion == 'cancelled'}}136 if: ${{ cancelled() }} 127 137 128 138 steps: -
trunk/.github/workflows/test-coverage.yml
r51868 r51921 169 169 file: wp-code-coverage-multisite-clover-${{ github.sha }}.xml 170 170 flags: multisite,php 171 172 slack-notifications: 173 name: Slack Notifications 174 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@master 175 needs: [ test-coverage-report ] 176 if: ${{ always() }} -
trunk/.github/workflows/test-npm.yml
r51535 r51921 155 155 - name: Ensure version-controlled files are not modified or deleted during building and cleaning 156 156 run: git diff --exit-code 157 158 slack-notifications: 159 name: Slack Notifications 160 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@master 161 needs: [ test-npm, test-npm-macos ] 162 if: ${{ always() }} -
trunk/.github/workflows/test-old-branches.yml
r51535 r51921 70 70 ref: '${{ matrix.branch }}' 71 71 }); 72 73 slack-notifications: 74 name: Slack Notifications 75 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@master 76 needs: [ dispatch-workflows-for-old-branches ] 77 if: ${{ always() }}
Note: See TracChangeset
for help on using the changeset viewer.