Skip to content

feat: add semantic-release-backmerge #193

feat: add semantic-release-backmerge

feat: add semantic-release-backmerge #193

Workflow file for this run

name: Create/update release pull request
on:
pull_request:
branches:
- master
workflow_dispatch:
env:
YALESITES_BUILD_TOKEN: ${{ secrets.YALESITES_BUILD_TOKEN }}
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
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Git setup
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
- name: Get next release number
run: |
git branch develop origin/develop
git merge develop --no-edit -X theirs
git status
npm install --force
npx --no-install semantic-release --no-ci --dry-run --branches master
next_version=$(npx --no-install semantic-release --no-ci --dry-run --branches master 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
run: |
git checkout -b "$release_branch"
git push origin "$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