2023-01-27 07:26:54 +00:00
|
|
|
name: 'Pull request post-merge processing'
|
2021-07-29 14:47:27 +00:00
|
|
|
on:
|
2023-01-27 07:26:54 +00:00
|
|
|
pull_request_target:
|
|
|
|
types: [closed]
|
2023-02-21 17:21:29 +00:00
|
|
|
paths:
|
|
|
|
- 'packages/**'
|
|
|
|
- 'plugins/woocommerce/**'
|
|
|
|
- 'plugins/woocommerce-admin/**'
|
2021-04-15 15:16:00 +00:00
|
|
|
|
2023-01-02 17:28:11 +00:00
|
|
|
permissions: {}
|
|
|
|
|
2021-04-15 15:16:00 +00:00
|
|
|
jobs:
|
2023-01-27 07:26:54 +00:00
|
|
|
process-pull-request-after-merge:
|
|
|
|
name: "Process a pull request after it's merged"
|
|
|
|
if: github.event.pull_request.merged == true
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
permissions:
|
|
|
|
pull-requests: write
|
|
|
|
steps:
|
|
|
|
- name: 'Get the action scripts'
|
|
|
|
run: |
|
|
|
|
scripts="assign-milestone-to-merged-pr.php add-post-merge-comment.php post-request-shared.php"
|
|
|
|
for script in $scripts
|
|
|
|
do
|
|
|
|
curl \
|
|
|
|
--silent \
|
|
|
|
--fail \
|
|
|
|
--header 'Authorization: bearer ${{ secrets.GITHUB_TOKEN }}' \
|
|
|
|
--header 'User-Agent: GitHub action to set the milestone for a pull request' \
|
|
|
|
--header 'Accept: application/vnd.github.v3.raw' \
|
|
|
|
--output $script \
|
|
|
|
--location "$GITHUB_API_URL/repos/${{ github.repository }}/contents/.github/workflows/scripts/$script?ref=${{ github.event.pull_request.base.ref }}"
|
|
|
|
done
|
|
|
|
env:
|
|
|
|
GITHUB_API_URL: ${{ env.GITHUB_API_URL }}
|
|
|
|
- name: 'Install PHP'
|
|
|
|
uses: shivammathur/setup-php@8e2ac35f639d3e794c1da1f28999385ab6fdf0fc
|
|
|
|
with:
|
|
|
|
php-version: '7.4'
|
|
|
|
- name: 'Run the script to assign a milestone'
|
2023-11-03 18:22:07 +00:00
|
|
|
if: github.event.pull_request.base.ref == 'trunk'
|
2023-01-27 07:26:54 +00:00
|
|
|
run: php assign-milestone-to-merged-pr.php
|
|
|
|
env:
|
|
|
|
PULL_REQUEST_ID: ${{ github.event.pull_request.node_id }}
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2023-07-17 22:01:36 +00:00
|
|
|
- name: 'Add the label for PR analysis'
|
2023-08-03 13:35:51 +00:00
|
|
|
if: |
|
|
|
|
github.event.pull_request.base.ref == 'trunk' &&
|
|
|
|
! contains(github.event.pull_request.labels.*.name, 'status: analysis complete')
|
2023-07-17 22:01:36 +00:00
|
|
|
uses: actions-ecosystem/action-add-labels@bd52874380e3909a1ac983768df6976535ece7f8
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
labels: 'needs: analysis'
|
2023-07-20 19:09:46 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
sparse-checkout: |
|
|
|
|
.github/actions/pr-scrub-notify-slack
|
|
|
|
ref: trunk
|
|
|
|
- name: 'Trigger PR scrub'
|
|
|
|
if: |
|
|
|
|
github.event.pull_request.base.ref == 'trunk' &&
|
2023-08-03 13:35:51 +00:00
|
|
|
! contains(github.event.pull_request.labels.*.name, 'needs: analysis') &&
|
|
|
|
! contains(github.event.pull_request.labels.*.name, 'status: analysis complete')
|
2023-07-20 19:09:46 +00:00
|
|
|
uses: ./.github/actions/pr-scrub-notify-slack
|
|
|
|
with:
|
|
|
|
TEST_ASSISTANCE_BOT_TOKEN: ${{ secrets.TEST_ASSISTANCE_BOT_TOKEN }}
|
|
|
|
WOO_PR_TESTING_ANALYSIS_SLACK_CHANNEL: ${{ secrets.WOO_PR_TESTING_ANALYSIS_SLACK_CHANNEL }}
|
|
|
|
WOO_PR_TESTING_ANALYSIS_TEAM_ID: ${{ secrets.WOO_PR_TESTING_ANALYSIS_TEAM_ID }}
|