forked from cloudnative-pg/cloudnative-pg
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (34 loc) · 997 Bytes
/
release-pr.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
# Create a PR for a release when a commit is pushed on a release/v* branch
name: release-pr
on:
push:
branches:
- release/v*
jobs:
pull-request:
runs-on: ubuntu-24.04
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Get tag
run: |
TAG=${GITHUB_REF##*/v}
if [[ "${TAG}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
DEST=$(echo ${TAG} | awk -F '[.]' '{print "release-"$1"."$2}')
else
DEST="main"
fi
echo "TAG=${TAG}" >> $GITHUB_ENV
echo "DEST=${DEST}" >> $GITHUB_ENV
-
name: Pull Request
id: open-pr
uses: repo-sync/[email protected]
with:
destination_branch: ${{ env.DEST }}
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_body: "Automated PR. Will trigger the ${{ env.TAG }} release when approved."
pr_label: release
pr_title: "Version tag to ${{ env.TAG }}"