Create/update release pull request #52
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: | |
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] | |
git merge origin/develop --no-edit -X theirs | |
- name: Get next release number | |
run: | | |
npm install --force | |
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 |