Skip to content

Production Release PR Creation #7

Production Release PR Creation

Production Release PR Creation #7

name: 'Production Release PR Creation'
on:
workflow_dispatch:
inputs:
version:
required: true
type: choice
description: Which version should be published?
options:
- prerelease
- prepatch
- preminor
- premajor
- patch
- minor
- major
jobs:
create_stencil_playwright_release_pr:
name: Generate Stencil Playwright Release PR
runs-on: ubuntu-latest
steps:
# Log the input from GitHub Actions for easy traceability
- name: Log GitHub Input
run: |
echo "Version: ${{ inputs.version }}"
shell: bash
- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Get Core Dependencies
uses: ./.github/workflows/actions/get-core-dependencies
- name: Bump the Version
run: npm version ${{ inputs.version }} --no-git-tag
- name: Log Generated Changes
run: git --no-pager diff
shell: bash
- name: Generate Version String and Branch Name
id: name_gen
run: |
VERSION_STR=$(jq '.version' package.json | sed s/\"//g)
echo "VERSION_STR=$VERSION_STR" >> "$GITHUB_OUTPUT"
echo "BRANCH_NAME=release/$VERSION_STR-run-${{ github.run_number }}-${{ github.run_attempt }}" >> "$GITHUB_OUTPUT"
shell: bash
- name: Print Version String and Branch Name
run: |
echo Version: ${{ steps.name_gen.outputs.VERSION_STR }}
echo Branch Name: ${{ steps.name_gen.outputs.BRANCH_NAME }}
shell: bash
- name: Create the Pull Request
uses: peter-evans/create-pull-request@a4f52f8033a6168103c2538976c07b467e8163bc # v6.0.1
with:
# specifies the name of the branch to create off of the base branch
branch: '${{ steps.name_gen.outputs.BRANCH_NAME }}'
# TODO(STENCIL-1029): Remove this once pipeline is 'ready'
draft: true
# create a commit message containing the semver version, prefixed with a 'v' - e.g. 'v4.1.0'
commit-message: 'v${{ steps.name_gen.outputs.VERSION_STR }}'
# set the title of the pull request, otherwise it'll default to generic message
title: 'Release v${{ steps.name_gen.outputs.VERSION_STR }}'
# the body of the pull request summary can be empty
body: ''