From 77ba90287194cac256ca04b9ef982952bab8ea9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D2=89=CE=B1k=CE=B1=20x=E2=A0=A0=E2=A0=B5?= <32862241+4k4xs4pH1r3@users.noreply.github.com> Date: Thu, 8 Aug 2024 20:19:49 -0500 Subject: [PATCH] Create auto_merge.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ҉αkα x⠠⠵ <32862241+4k4xs4pH1r3@users.noreply.github.com> --- .github/workflows/auto_merge.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/auto_merge.yml diff --git a/.github/workflows/auto_merge.yml b/.github/workflows/auto_merge.yml new file mode 100644 index 0000000..839766d --- /dev/null +++ b/.github/workflows/auto_merge.yml @@ -0,0 +1,31 @@ +name: Auto Update and Merge + +on: + schedule: + - cron: '*/5 * * * *' # Run every 5 minutes + pull_request_target: + types: [assigned, unassigned, labeled, unlabeled, opened, edited, reopened, synchronize, ready_for_review, locked, unlocked, review_requested, review_request_removed, auto_merge_enabled, auto_merge_disabled] + branches: + - main # Replace 'target-branch' with your actual branch name + + +jobs: + auto-merge: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4.1.7 + with: + fetch-depth: 0 # Fetch all history for merging + ref: ${{ github.event.pull_request.head.ref }} # Checkout the PR's branch + + - name: Merge PR into main + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git checkout main + git pull origin main # Ensure main is up-to-date + git merge ${{ github.event.pull_request.head.ref }} --no-ff # Merge the PR's branch + + - name: Push changes + run: git push origin main