Create/update release pull request #46
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create/update release pull request | |
on: | |
pull_request: | |
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 | |
with: | |
ref: master | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Get next release number | |
run: | | |
git merge develop | |
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/[email protected] | |
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 | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# - name: Create pull request | |
# run: ./.ci/github/create_release_pull_request |