-
Notifications
You must be signed in to change notification settings - Fork 4
52 lines (45 loc) · 1.59 KB
/
release.branch.yml
File metadata and controls
52 lines (45 loc) · 1.59 KB
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
name: Create PR for Release Branch
on:
create:
jobs:
create_release_branch:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/heads/release-')
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set Version as env var
run: |
branch_name=$(echo ${{ github.ref }} | sed 's/refs\/heads\///')
VERSION=${branch_name#release-}
echo "VERSION=$VERSION" >> $GITHUB_ENV
- uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'yarn'
- name: Run Lerna version
run: npx lerna version v$VERSION --no-git-tag-version --tag-version-prefix='' --yes
- name: Commit changes
run: |
git config --local user.email user.email "hello@polybase.xyz"
git config --local user.name "Polybase CI"
git add .
git commit -m "Bump versions" || echo "No changes to commit"
git push
- name: Create Pull Request
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_TOKEN }}
run: |
branch_name=$(echo ${{ github.ref }} | sed 's/refs\/heads\///')
curl -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/pulls \
-d '{
"title": "Release 'v$VERSION'",
"body": "This is an automated PR for release '$VERSION'",
"head": "'$branch_name'",
"base": "main"
}'