From 58cebdf6176ba54c3e754a4839993bfe78d5a53a Mon Sep 17 00:00:00 2001 From: Davide Marchegiani Date: Mon, 22 Jul 2024 18:05:13 +1000 Subject: [PATCH] Added test workflow for automatic merge (using test branches 'main_test' and 'development_test') --- .github/workflows/automatic_merge.yml | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/automatic_merge.yml diff --git a/.github/workflows/automatic_merge.yml b/.github/workflows/automatic_merge.yml new file mode 100644 index 000000000..bd80974b0 --- /dev/null +++ b/.github/workflows/automatic_merge.yml @@ -0,0 +1,30 @@ +name: Automatic merge + +on: + push: + schedule: + # Run every Sunday at 03:07 (AEDT) + # AEDT is UTC+10 --> Sunday at 03:07 AEDT is Saturday at 17:07 UTC + - cron: "7 17 * * SAT" + workflow_dispatch: + +jobs: + auto-merge: + runs-on: ubuntu-latest + permissions: write-all + steps: + - name: Checkout repo + uses: actions/checkout@master + with: + ref: main_test + fetch-depth: 0 + token: ${{ secrets.ADMIN_TOKEN }} + + - name: Merge development to main + run: | + git config --global user.name "GitHub Actions" + git config --global user.email "github-actions@github.com" + git checkout main_test + git merge --no-ff -X theirs origin/development_test -m "Automatically merge 'development' to 'main'. + Merge commit issued by the automatic_merge workflow." + git push origin main_test