Create Release Branch and PR #79
This file contains hidden or 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 release date and branch name | |
| run: | | |
| RELEASE_DATE=$(date +'%Y-%m-%d') | |
| echo "RELEASE_DATE=$RELEASE_DATE" >> $GITHUB_ENV | |
| echo "BRANCH_NAME=release/$RELEASE_DATE" >> $GITHUB_ENV | |
| - name: Create or update branch | |
| run: | | |
| git checkout -B $BRANCH_NAME | |
| git push --force --set-upstream origin $BRANCH_NAME | |
| - name: Create pull request using GitHub CLI | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh pr create \ | |
| --base main \ | |
| --head $BRANCH_NAME \ | |
| --title "release: $RELEASE_DATE" \ | |
| --body ":rocket: Automated release PR" \ | |
| --label release,auto-pr |