batch-example/.gitea/workflows/pr-closed.yml

31 lines
1.1 KiB
YAML

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:
- uses: http://sigyl.com:3000/actions/checkout@v3.5.4
- name: on-merge
run: |
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 }}
- name: delete develop branch
run: git push origin --delete ${{ github.head_ref }}
- name: get build branch name
run: |
firstString=${{ github.head_ref }}
secondString="build-"
echo ::set-env name=BUILD_BRANCH::${firstString/develop-/"$secondString"}
- name: delete build branch
run: git push origin --delete ${{ env.BUILD_BRANCH }}