-
Notifications
You must be signed in to change notification settings - Fork 17
40 lines (34 loc) · 1.17 KB
/
create-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
38
39
name: Create Release PR
on:
push:
branches:
- pre-release-[0-9]+.[0-9]+.[0-9]+
permissions:
pull-requests: write
jobs:
create-release-pr:
name: Create Release PR
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
persist-credentials: false
- name: Extract release version
id: extract_release_version
run: |
next_version=$(echo "${{ github.ref_name }}" | \
awk 'match($0, /[0-9]+\.[0-9]+\.[0-9]+/) { print substr($0, RSTART, RLENGTH) }')
# assert next_version is not empty
[[ ! -z "$next_version" ]] || exit 1
# export to outputs
echo "version=$next_version" >> "$GITHUB_OUTPUT"
- name: Create PR
env:
GH_TOKEN: ${{ github.token }}
RELEASE_VERSION: ${{ steps.extract_release_version.outputs.version }}
run: |
gh pr create \
--title "[release-spm]: Version and checksum update for $RELEASE_VERSION" \
--body "Update for package manifest and version for the next release" \
--base main