Skip to content

Create Release Branch and PR #8

Create Release Branch and PR

Create Release Branch and PR #8

name: Create Release Branch and PR
on:
workflow_dispatch:
jobs:
create-release-branch:
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v4
with:
ref: dev
- name: Get current date
id: get_date
run: echo "current_date=$(date +"%d-%m-%Y")" >> $GITHUB_ENV
- name: Create or update branch
run: |
git checkout -B release/release-${{ env.current_date }}
git push --force --set-upstream origin release/release-${{ env.current_date }}
- name: Create pull request using GitHub CLI
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create \
--base main \
--head release/release-${{ env.current_date }} \
--title "release: ${{ env.current_date }}" \
--body ":rocket: Automated release PR" \
--label release,auto-pr \