Create Release Branch and PR #8
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 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 \ |