From 572d778b4b480e66a986d29111e6069d839b1ffe Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Mon, 26 Aug 2024 09:03:03 +0800 Subject: [PATCH] Try to "debounce" this automerge workflow --- .github/workflows/i18n-automerge.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/i18n-automerge.yml b/.github/workflows/i18n-automerge.yml index 354b3d67..6ba6df40 100644 --- a/.github/workflows/i18n-automerge.yml +++ b/.github/workflows/i18n-automerge.yml @@ -12,14 +12,21 @@ jobs: github.event.pull_request.base.ref == 'main' && github.event.pull_request.head.ref == 'l10n_main' runs-on: ubuntu-latest - # concurrency: - # group: ${{ github.workflow }}-${{ github.ref }} - # cancel-in-progress: true steps: - uses: actions/checkout@v4 with: fetch-depth: 0 + - run: sleep 15 + + - name: Check if the branch is dirty + run: | + git fetch origin ${{ github.event.pull_request.head.ref }} + if [ $(git rev-parse HEAD) != $(git rev-parse origin/${{ github.event.pull_request.head.ref }}) ]; then + echo "Branch is dirty. Exiting..." + exit 0 + fi + - name: Check auto-merge conditions run: | BASE_SHA="${{ github.event.pull_request.base.sha }}"