merge-pr #1819
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: Merge pull request | |
| on: | |
| repository_dispatch: | |
| types: [merge-pr] | |
| jobs: | |
| Merge_pull_request: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Resolve possible conflicts ${{ github.event.client_payload.ReleaseBranchName }} with main | |
| run: | | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "Actions service account" | |
| git checkout ${{ github.event.client_payload.ReleaseBranchName }}-docs | |
| git merge --no-edit --strategy-option=ours main | |
| git push origin ${{ github.event.client_payload.ReleaseBranchName }}-docs | |
| sleep 30 | |
| - name: Approve pull request by GitHub-Actions bot | |
| uses: actions/github-script@v8 | |
| with: | |
| github-token: ${{secrets.PRAPPROVAL_SECRET}} | |
| script: | | |
| github.rest.pulls.createReview({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: ${{ github.event.client_payload.PullRequestNumber }}, | |
| event: "APPROVE" | |
| }); | |
| - name: Merge pull request for ${{ github.event.client_payload.ReleaseBranchName }} | |
| uses: actions/github-script@v8 | |
| with: | |
| github-token: ${{secrets.GITHUB_TOKEN}} | |
| script: | | |
| github.rest.pulls.merge({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: ${{ github.event.client_payload.PullRequestNumber }}, | |
| merge_method: "squash" | |
| }) |