Skip to content

Merge bump packages PR #76

Merge bump packages PR

Merge bump packages PR #76

name: Merge bump packages PR
on:
workflow_dispatch:
schedule:
# Each Tuesday at 5 AM UTC
- cron: "0 5 * * 2"
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