Skip to content

Commit 5cb233b

Browse files
AST-43037 push version tag through PR (#641)
* AST-43037 push version tag through PR * Update release.yml * Update release.yml
1 parent 1d54dcd commit 5cb233b

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

.github/workflows/release.yml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
runs-on: ubuntu-latest
5151
env:
5252
GITHUB_TOKEN: ${{ secrets.OR_GITHUB_TOKEN }}
53+
BRANCH_NAME: npm-version-patch
5354
steps:
5455

5556
# CHECKOUT PROJECT
@@ -91,10 +92,34 @@ jobs:
9192
npm ci
9293
npm run build
9394
94-
# PUSH TAGS IF IT IS A RELEASE
95-
- name: Push tag if release
95+
# CREATE PR FOR VERSION AND TAG CHANGES
96+
- name: Create Pull Request
97+
id: create_pr
9698
if: inputs.dev == false
97-
run: git push && git push --tags
99+
uses: peter-evans/[email protected]
100+
with:
101+
token: ${{ env.GITHUB_TOKEN }}
102+
branch: ${{ env.BRANCH_NAME }}
103+
title: "Update Version - Automated Changes"
104+
body: "This is an automated PR created by GitHub Actions"
105+
base: main
106+
draft: false
107+
108+
# WAIT FOR PR CREATION
109+
- name: Wait for PR to be created
110+
id: pr
111+
if: inputs.dev == false
112+
uses: octokit/[email protected]
113+
with:
114+
route: GET /repos/${{ github.repository }}/pulls?head=${{ github.repository_owner }}:${{ env.BRANCH_NAME }}
115+
116+
# MERGE PR TO MAIN
117+
- name: Merge Pull Request
118+
if: inputs.dev == false
119+
uses: octokit/[email protected]
120+
with:
121+
route: PUT /repos/${{ github.repository }}/pulls/${{ steps.create_pr.outputs.pull-request-number }}/merge
122+
merge_method: squash
98123

99124
# PUBLISH NPM PACKAGE
100125
- name: Publish npm package

0 commit comments

Comments
 (0)