release-prepare-monthly #3
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: release-prepare-monthly | |
| on: | |
| schedule: | |
| # Runs at midnight UTC on the 1st of every month | |
| - cron: '0 0 1 * *' | |
| workflow_dispatch: | |
| jobs: | |
| create-release-pr: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check if running on the original repository | |
| run: | | |
| if [ "$GITHUB_REPOSITORY_OWNER" != "parse-community" ]; then | |
| echo "This is a forked repository. Exiting." | |
| exit 1 | |
| fi | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: true | |
| token: ${{ secrets.RELEASE_GITHUB_TOKEN }} | |
| - name: Get current branch name | |
| id: branch | |
| run: echo "BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV | |
| - name: Generate timestamp | |
| id: timestamp | |
| run: echo "TIMESTAMP=$(date +'%Y%m%d')" >> $GITHUB_ENV | |
| - name: Create new branch | |
| run: | | |
| git checkout -b build/release-${{ env.TIMESTAMP }} | |
| git push origin build/release-${{ env.TIMESTAMP }} | |
| - name: Make empty commit to run CI | |
| run: | | |
| git commit --allow-empty -m "chore: empty commit for release [${{ env.TIMESTAMP }}]" | |
| git push origin build/release-${{ env.TIMESTAMP }} | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v6 | |
| with: | |
| token: ${{ secrets.RELEASE_GITHUB_TOKEN }} | |
| branch: build/release-${{ env.TIMESTAMP }} | |
| base: release | |
| title: "build: Release" | |
| body: "This is an automated pull request for the monthly release cycle." | |
| draft: false |