Create Release Branch #64
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 | |
on: | |
schedule: | |
- cron: '0 6 * * 1' | |
workflow_dispatch: | |
jobs: | |
create_release_branch: | |
runs-on: [ ubuntu-latest ] | |
permissions: | |
contents: write # for `git push` | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- name: Create release branch | |
run: git checkout -b releases/${{ steps.date.outputs.date }} | |
- name: Push new branch | |
run: git push origin releases/${{ steps.date.outputs.date }} | |
- name: Create pull request into release | |
env: | |
GH_TOKEN: ${{ secrets.CI_ACCESS_TOKEN }} | |
run: | | |
cat << EOF > body.md | |
## Release ${{ steps.date.outputs.date }} | |
**Please merge this PR using 'Create a merge commit'!** | |
EOF | |
gh pr create --title "Release ${{ steps.date.outputs.date }}" \ | |
--body-file "body.md" \ | |
--head "releases/${{ steps.date.outputs.date }}" \ | |
--base "release" |