Quarterly Api Versions Update #24
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: Quarterly Api Versions Update | |
| on: | |
| schedule: | |
| # Schedule to run at the end of every quarter | |
| - cron: '0 0 1 1,4,7,10 *' | |
| workflow_dispatch: | |
| jobs: | |
| update-version: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '14' | |
| - name: Install Yarn | |
| run: npm install -g [email protected] | |
| - name: Change to API directory | |
| run: cd packages/api | |
| - name: Pull latest changes from main branch | |
| run: git pull origin main --rebase | |
| working-directory: ./packages/api | |
| - name: Install API dependencies | |
| run: yarn install | |
| working-directory: ./packages/api | |
| - name: Update Version | |
| run: yarn update-versions | |
| working-directory: ./packages/api | |
| - name: Commit and Push Changes | |
| run: | | |
| git config user.name "Auto Bot" | |
| git config user.email "[email protected]" | |
| yarn version --new-version major --no-git-tag-version | |
| git add . | |
| git restore --staged yarn.lock | |
| git commit -m "Automate version update" | |
| git push origin HEAD:versions-update-${{ github.sha }} | |
| working-directory: ./packages/api | |
| - name: Create Pull Request | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh pr create \ | |
| --body "Automated changes to update the AvailableVersions enum and bump the patch version in the API package." \ | |
| --title "chore: Quarterly API Version Update" \ | |
| --head "versions-update-${{ github.sha }}" \ | |
| --base "main" |