From 4588ad77bb6b2a216a3f66ffbfcffb378b597a6f Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Wed, 11 Jun 2025 14:36:48 +0100 Subject: [PATCH 1/2] Automatically label PRs to sync by default (#822) --- .github/workflows/pr-auto-label.yml | 26 ++++++++++++++++++++++++++ .github/workflows/pr-auto-merge.yml | 23 +++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/pr-auto-label.yml create mode 100644 .github/workflows/pr-auto-merge.yml diff --git a/.github/workflows/pr-auto-label.yml b/.github/workflows/pr-auto-label.yml new file mode 100644 index 00000000..c84f50eb --- /dev/null +++ b/.github/workflows/pr-auto-label.yml @@ -0,0 +1,26 @@ +name: "Automatically mark PRs to sync" + +on: + pull_request: + types: + - opened + +jobs: + labeler: + if: github.event.pull_request.user.type != 'Bot' + permissions: + pull-requests: write + + runs-on: ubuntu-latest + steps: + - name: Add "sync" label to PR + run: gh pr edit "$PR_URL" --add-label sync + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_URL: ${{ github.event.pull_request.html_url }} + + - name: Comment on PR to explain sync label + run: gh pr comment "$PR_URL" --body "This pull request has been marked to **automatically sync** to its base branch. You can **disable** this behavior by removing the `sync` label." + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_URL: ${{ github.event.pull_request.html_url }} diff --git a/.github/workflows/pr-auto-merge.yml b/.github/workflows/pr-auto-merge.yml new file mode 100644 index 00000000..1773d84f --- /dev/null +++ b/.github/workflows/pr-auto-merge.yml @@ -0,0 +1,23 @@ +name: "Automatically enable auto-merge on PRs" + +on: + pull_request_target: + 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.PR_AUTO_UPDATE_TOKEN }} + PR_URL: ${{ github.event.pull_request.html_url }} From f01b9ba587def0ea9c73350d332ded337850cf4b Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Wed, 11 Jun 2025 14:37:35 +0100 Subject: [PATCH 2/2] Create test_file.md Signed-off-by: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> --- test_file.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 test_file.md diff --git a/test_file.md b/test_file.md new file mode 100644 index 00000000..85ec3e0d --- /dev/null +++ b/test_file.md @@ -0,0 +1,3 @@ +# Test + +just a test of the auto stuff