-
Notifications
You must be signed in to change notification settings - Fork 16
71 lines (59 loc) · 1.97 KB
/
branch-delete.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Branch - Delete Release
on:
workflow_dispatch:
inputs:
majorMinorVersion:
description: 'Major.minor version (for example 18.0)'
required: true
majorMinorVersionConfirmation:
description: 'Confirm major.minor version'
required: true
concurrency: rel-branches
defaults:
run:
shell: bash
jobs:
show-inputs:
runs-on: ubuntu-latest
steps:
- run: |
echo "Major.minor version: ${{ inputs.majorMinorVersion }} " >> $GITHUB_STEP_SUMMARY
env:
uses: ./.github/workflows/x-env.yml
delete-workflow-branch:
name: Delete workflow branch
runs-on: ubuntu-latest
needs: [env]
if: github.event.inputs.majorMinorVersion != 'main' && github.event.inputs.majorMinorVersion == github.event.inputs.majorMinorVersionConfirmation
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
path: keycloak-rel
ref: main
token: ${{ secrets.GH_TOKEN }}
- name: Push release branch
run: git push origin :release/${{ github.event.inputs.majorMinorVersion }}
working-directory: keycloak-rel
delete-release-branches:
name: Delete release branch
runs-on: ubuntu-latest
needs: [env]
if: github.event.inputs.majorMinorVersion != 'main' && github.event.inputs.majorMinorVersion == github.event.inputs.majorMinorVersionConfirmation
continue-on-error: true
strategy:
matrix:
repository:
- keycloak
- keycloak-nodejs-connect
- keycloak-quickstarts
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
repository: '${{ needs.env.outputs.gh-org }}/${{ matrix.repository }}'
token: ${{ secrets.GH_TOKEN }}
path: ${{ matrix.repository }}
- name: Delete release branch
run: git push origin :release/${{ github.event.inputs.majorMinorVersion }}
working-directory: ${{ matrix.repository }}