From bab16c64b9f574ac7595359f556ee81a886de184 Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Mon, 9 Jun 2025 09:36:16 +0100 Subject: [PATCH 1/2] Create workflow to automatically enable auto-merge on PRs Signed-off-by: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> --- .github/workflows/enable-auto-merge.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/enable-auto-merge.yml diff --git a/.github/workflows/enable-auto-merge.yml b/.github/workflows/enable-auto-merge.yml new file mode 100644 index 00000000..f5fec4a8 --- /dev/null +++ b/.github/workflows/enable-auto-merge.yml @@ -0,0 +1,23 @@ +name: "Automatically enable auto-merge on PRs" + +on: + pull_request: + types: + - opened + - ready_for_review + branches: + - main + +jobs: + enable-automerge: + if: github.event.pull_request.draft == false + permissions: + pull-requests: write + + runs-on: ubuntu-latest + steps: + - name: Enable auto-merge for the PR + run: gh pr merge "$PR_URL" --auto --squash + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_URL: ${{ github.event.pull_request.html_url }} From 711978063e16d6e52c459e84596eba6e6c3f7f37 Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Mon, 9 Jun 2025 09:40:42 +0100 Subject: [PATCH 2/2] Update enable-auto-merge.yml Signed-off-by: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> --- .github/workflows/enable-auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/enable-auto-merge.yml b/.github/workflows/enable-auto-merge.yml index f5fec4a8..74791465 100644 --- a/.github/workflows/enable-auto-merge.yml +++ b/.github/workflows/enable-auto-merge.yml @@ -1,7 +1,7 @@ name: "Automatically enable auto-merge on PRs" on: - pull_request: + pull_request_target: types: - opened - ready_for_review