Skip to content

Commit

Permalink
feat: get release version and create branch
Browse files Browse the repository at this point in the history
  • Loading branch information
vinmassaro authored Jan 29, 2024
1 parent 91d1964 commit 8540ee5
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions .github/workflows/release_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,34 @@ on:
branches:
- master
workflow_dispatch:
env:
ACCESS_TOKEN: ${{ secrets.YALESITES_BUILD_TOKEN }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.number }}
jobs:
get_next_release_version:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get next release number
run: |
npm install
next_version=$(npx --no-install semantic-release --no-ci --dry-run 2>/dev/null | sed -nE 's/.*the next release version is ([0-9]+\.[0-9]+\.[0-9]+).*/\1/p')
echo release_branch="rel-${next_version//.}" >> "$GITHUB_ENV"
- name: Create release branch
uses: peterjgrainger/action-create-branch@v2
env:
GITHUB_TOKEN: ${{ env.ACCESS_TOKEN }}
with:
branch: ${{ env.release_branch }}

create_pull_request:
if: github.head_ref == 'develop' ||
github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
env:
ACCESS_TOKEN: ${{ secrets.YALESITES_BUILD_TOKEN }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.number }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down

0 comments on commit 8540ee5

Please sign in to comment.