Merge bump packages PR #106
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: Merge bump packages PR | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| # Each Tuesday at 5 AM UTC | |
| - cron: "0 5 * * 2" | |
| permissions: | |
| contents: none # We use the github app token to merge the PR | |
| jobs: | |
| merge_bump_packages_pr: | |
| name: Merge bump packages PR | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Create Github App Token | |
| uses: mongodb-js/devtools-shared/actions/setup-bot-token@main | |
| id: app-token | |
| with: | |
| app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }} | |
| private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }} | |
| - name: Merge PR | |
| env: | |
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
| run: | | |
| set -e | |
| PR_NUMBER=$(gh pr list -s open --head=ci/bump-packages --limit=1 --json number | jq '.[0].number') | |
| if [ -n "${PR_NUMBER}" ]; then | |
| gh pr checks "${PR_NUMBER}" --watch --fail-fast | |
| echo "Merging PR #${PR_NUMBER}" | |
| gh pr merge "${PR_NUMBER}" --squash --delete-branch | |
| else | |
| echo "PR not found" | |
| fi |