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

52 lines
1.7 KiB
YAML
Raw Normal View History

name: build-develop-branch
run-name: ${{ github.actor }} is learning GitHub Actions
on:
pull_request:
types:
- closed
2023-10-22 19:26:39 +00:00
#branches:
# - 'develop-**'
jobs:
2023-10-22 19:09:43 +00:00
delete:
runs-on: ubuntu-latest
steps:
- uses: http://sigyl.com:3000/actions/checkout@v3.5.4
2023-10-22 18:51:22 +00:00
with:
token: ${{ secrets.BOT_TOKEN }}
- name: delete develop branch
id: delete_develop_branch
run: git push origin --delete ${{ github.head_ref }}
continue-on-error: true
- uses: mainmatter/continue-on-error-comment@v1
with:
2023-10-22 17:34:45 +00:00
repo-token: ${{ github.token }}
outcome: ${{ steps.delete_develop_branch.outcome }}
test-id: Error code ${{ matrix.code }}
- name: get build branch name
run: |
firstString=${{ github.head_ref }}
secondString="build-"
2023-10-22 19:09:43 +00:00
echo ::set-env name=BUILD_BRANCH::${firstString/develop-/"$secondString"}
if_merged:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: http://sigyl.com:3000/actions/checkout@v3.5.4
with:
token: ${{ secrets.BOT_TOKEN }}
- name: delete develop branch
id: delete_develop_branch
run: git push origin --delete ${{ github.head_ref }}
continue-on-error: true
- uses: mainmatter/continue-on-error-comment@v1
with:
2023-10-22 17:34:45 +00:00
repo-token: ${{ github.token }}
2023-10-22 19:09:43 +00:00
outcome: ${{ steps.delete_develop_branch.outcome }}
test-id: Error code ${{ matrix.code }}
2023-10-22 19:09:43 +00:00
- name: get build branch name
run: |
firstString=${{ github.head_ref }}
2023-10-22 19:09:43 +00:00
secondString="build-"
echo ::set-env name=BUILD_BRANCH::${firstString/develop-/"$secondString"}