Skip to content

Commit

Permalink
fix(.github): update release commit workflow to open PR
Browse files Browse the repository at this point in the history
  • Loading branch information
narekhovhannisyan committed May 17, 2024
1 parent 3c6bb07 commit 98fa5f1
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/release-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ name: Release commit
on:
release:
types: [published]
jobs:

env:
PR_BRANCH_NAME: release-${{github.event.release.tag_name}}

jobs:
build:
runs-on: ubuntu-latest
steps:
Expand All @@ -28,7 +31,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main
ref: ${{ github.event.repository.default_branch }}

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -41,10 +44,24 @@ jobs:

- name: Initalize git user email
run: git config --global user.email "${{vars.RELEASE_USER_EMAIL}}"

- name: Initalize git user name
run: git config --global user.name "Release commit workflow"

- name: Init release commit
run: npm run release -- --ci ${{github.event.release.tag_name}}
- name: Create release branch
run: |
git checkout -b $PR_BRANCH_NAME
git push --set-upstream origin $PR_BRANCH_NAME
echo "branch=$PR_BRANCH_NAME" >> $GITHUB_ENV
- name: Bump version and push changes using release-it
run: |
npm run release -- --ci ${{github.event.release.tag_name}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create pull request
run: gh pr create -B ${{ github.event.repository.default_branch }} -H $PR_BRANCH_NAME --title "Release ${{github.event.release.tag_name}}" --body "${{github.event.release.body}}"
env:
GITHUB_TOKEN: ${{secrets.github_token}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 98fa5f1

Please sign in to comment.