Quarterly Api Versions Update #15
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: 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: Change to API directory | |
run: cd packages/api | |
- name: Install API dependencies | |
run: npm install | |
working-directory: ./packages/api | |
- name: Update Version | |
run: npm run update-versions | |
working-directory: ./packages/api | |
- name: Commit and Push Changes | |
run: | | |
git config user.name "Auto Bot" | |
git config user.email "[email protected]" | |
git add . | |
npm version major --no-git-tag-version | |
git add . | |
git restore --staged package-lock.json | |
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" |