diff --git a/.github/workflows/release-auto-merge.yml b/.github/workflows/release-auto-merge.yml new file mode 100644 index 0000000..7edaa52 --- /dev/null +++ b/.github/workflows/release-auto-merge.yml @@ -0,0 +1,30 @@ +name: Release Auto-merge + +on: + schedule: + - cron: '0 9 * * 1' + workflow_dispatch: + +permissions: + pull-requests: write + contents: write + +jobs: + auto-merge: + name: Enable auto-merge on release PRs + runs-on: ubuntu-latest + steps: + - name: Enable auto-merge on release PRs + env: + GH_TOKEN: ${{ secrets.LOCALSTACK_BOT_TOKEN }} + GH_REPO: ${{ github.repository }} + run: | + gh pr list \ + --label "autorelease: pending" \ + --state open \ + --json number \ + --jq '.[].number' | \ + while read -r pr; do + echo "Enabling auto-merge on PR #$pr" + gh pr merge "$pr" --auto --squash + done