Cut Release Branch #13
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: 'Cut Release Branch' | |
permissions: | |
contents: write | |
pull-requests: write | |
on: | |
workflow_dispatch: # allow manual triggering | |
schedule: | |
- cron: '55 14 * * 4' # trigger every Thursday at 14:55 UTC (9:55 EST) | |
jobs: | |
cut-release-branch: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Compute branch name | |
id: branch_name | |
run: echo "branch_name=release-$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" | |
- name: Create release branch | |
run: | | |
git checkout -b ${{ steps.branch_name.outputs.branch_name }} | |
git push -u origin ${{ steps.branch_name.outputs.branch_name }} | |
- name: Create pull request | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh pr create \ | |
--base main \ | |
--head ${{ steps.branch_name.outputs.branch_name }} \ | |
--title "Release ${{ steps.branch_name.outputs.branch_name }}" \ | |
--body "Opened automatically by [cut-release-branch](https://github.com/evidence-dev/evidence/actions/runs/${{ github.run_id }})" |