2023-10-22 02:56:47 +00:00
|
|
|
name: build-develop-branch
|
|
|
|
run-name: ${{ github.actor }} is learning GitHub Actions
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types:
|
|
|
|
- closed
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
if_merged:
|
|
|
|
if: github.event.pull_request.merged == true
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-10-22 16:09:56 +00:00
|
|
|
- uses: http://sigyl.com:3000/actions/checkout@v3.5.4
|
2023-10-22 15:33:04 +00:00
|
|
|
- name: on-merge
|
|
|
|
run: |
|
2023-10-22 15:43:24 +00:00
|
|
|
echo The PR was merged into ${{ github.event.pull_request.base.ref }} from ${{ github.ref_name }} from ${{ github.ref }} type ${{ github.ref_type }}
|
|
|
|
echo head ref : ${{ github.event.pull_request.head.ref }}
|
|
|
|
echo base_ref : ${{ github.base_ref }}
|
|
|
|
echo head_ref : ${{ github.head_ref }}
|
|
|
|
echo env: ${{ env.GITHUB_HEAD_REF }}
|
|
|
|
echo env: ${{ env.GITHUB_BASE_REF }}
|
2023-10-22 16:09:56 +00:00
|
|
|
- name: delete develop branch
|
2023-10-22 16:21:31 +00:00
|
|
|
id: delete_develop_branch
|
2023-10-22 16:09:56 +00:00
|
|
|
run: git push origin --delete ${{ github.head_ref }}
|
2023-10-22 16:21:31 +00:00
|
|
|
continue-on-error: true
|
|
|
|
- uses: mainmatter/continue-on-error-comment@v1
|
|
|
|
with:
|
2023-10-22 17:48:44 +00:00
|
|
|
repo-token: ${{ github.token }}
|
2023-10-22 16:21:31 +00:00
|
|
|
outcome: ${{ steps.delete_develop_branch.outcome }}
|
|
|
|
test-id: Error code ${{ matrix.code }}
|
2023-10-22 16:09:56 +00:00
|
|
|
- name: get build branch name
|
|
|
|
run: |
|
|
|
|
firstString=${{ github.head_ref }}
|
|
|
|
secondString="build-"
|
2023-10-22 16:12:03 +00:00
|
|
|
echo ::set-env name=BUILD_BRANCH::${firstString/develop-/"$secondString"}
|
2023-10-22 16:09:56 +00:00
|
|
|
- name: delete build branch
|
2023-10-22 16:21:31 +00:00
|
|
|
id: delete_build_branch
|
2023-10-22 16:09:56 +00:00
|
|
|
run: git push origin --delete ${{ env.BUILD_BRANCH }}
|
2023-10-22 16:21:31 +00:00
|
|
|
continue-on-error: true
|
|
|
|
- uses: mainmatter/continue-on-error-comment@v1
|
|
|
|
with:
|
2023-10-22 17:48:44 +00:00
|
|
|
repo-token: ${{ github.token }}
|
2023-10-22 16:21:31 +00:00
|
|
|
outcome: ${{ steps.delete_build_branch.outcome }}
|
|
|
|
test-id: Error code ${{ matrix.code }}
|
2023-10-22 16:25:01 +00:00
|
|
|
- name: get build format branch name
|
|
|
|
run: |
|
|
|
|
firstString=${{ github.head_ref }}
|
|
|
|
secondString="format-"
|
|
|
|
echo ::set-env name=FORMAT_BRANCH::${firstString/develop-/"$secondString"}
|
|
|
|
- name: delete format branch
|
|
|
|
id: delete_format_branch
|
|
|
|
run: git push origin --delete ${{ env.FORMAT_BRANCH }}
|
|
|
|
continue-on-error: true
|
|
|
|
- uses: mainmatter/continue-on-error-comment@v1
|
|
|
|
with:
|
2023-10-22 17:48:44 +00:00
|
|
|
repo-token: ${{ github.token }}
|
2023-10-22 16:25:01 +00:00
|
|
|
outcome: ${{ steps.delete_format_branch.outcome }}
|
|
|
|
test-id: Error code ${{ matrix.code }}
|
|
|
|
|