From b359a781500883c70b2b22c77e92b04e71d6465f Mon Sep 17 00:00:00 2001 From: Abdel-Monaam-Aouini Date: Thu, 23 Mar 2023 16:44:10 +0100 Subject: [PATCH 01/11] feat: automerge PR --- .github/workflows/pr.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 68ca95c1..169c1c68 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -50,7 +50,7 @@ jobs: deploy: environment: testing runs-on: ubuntu-latest - needs: [test] + needs: [test, style] steps: - name: Checkout uses: actions/checkout@v3 @@ -100,3 +100,12 @@ jobs: PR_URL: ${{ github.event.pull_request.html_url }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + automerge: + runs-on: ubuntu-latest + needs: [deploy] + steps: + - id: automerge + name: automerge + uses: "pascalgn/automerge-action@v0.15.6" + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" From 6e6bbe33d2a92c2a0f732e455a5969f8e4c1ba78 Mon Sep 17 00:00:00 2001 From: Abdel-Monaam-Aouini Date: Thu, 23 Mar 2023 16:51:01 +0100 Subject: [PATCH 02/11] fix automerge approve --- .github/workflows/pr.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 169c1c68..2b465c03 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -104,8 +104,21 @@ jobs: runs-on: ubuntu-latest needs: [deploy] steps: + - name: Approve a PR + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - id: automerge name: automerge uses: "pascalgn/automerge-action@v0.15.6" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + LOG: "TRACE" # or "DEBUG" + MERGE_LABELS: "automerge,!work in progress" + MERGE_REMOVE_LABELS: "automerge" + MERGE_METHOD: "squash" + - name: feedback + if: steps.automerge.outputs.mergeResult == "merged" + run: | + echo "Pull request ${{ steps.automerge.outputs.pullRequestNumber }} merged!" From 9fa18c6b1eed7b36bad140a852054e85ac2ae653 Mon Sep 17 00:00:00 2001 From: Abdel-Monaam-Aouini Date: Thu, 23 Mar 2023 16:52:09 +0100 Subject: [PATCH 03/11] :) --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2b465c03..7985100e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -119,6 +119,6 @@ jobs: MERGE_REMOVE_LABELS: "automerge" MERGE_METHOD: "squash" - name: feedback - if: steps.automerge.outputs.mergeResult == "merged" + if: steps.automerge.outputs.mergeResult == '"merged"' run: | echo "Pull request ${{ steps.automerge.outputs.pullRequestNumber }} merged!" From 22b1d7a8d7f7aa5accb8d27a246a78bc976269e8 Mon Sep 17 00:00:00 2001 From: Abdel-Monaam-Aouini Date: Thu, 23 Mar 2023 16:54:27 +0100 Subject: [PATCH 04/11] clean --- .github/workflows/pr.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 7985100e..8a1c108f 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -104,11 +104,6 @@ jobs: runs-on: ubuntu-latest needs: [deploy] steps: - - name: Approve a PR - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - id: automerge name: automerge uses: "pascalgn/automerge-action@v0.15.6" @@ -118,6 +113,7 @@ jobs: MERGE_LABELS: "automerge,!work in progress" MERGE_REMOVE_LABELS: "automerge" MERGE_METHOD: "squash" + MERGE_REQUIRED_APPROVALS: "0" - name: feedback if: steps.automerge.outputs.mergeResult == '"merged"' run: | From 0a30df5aa6c493ae90659fec57adefb4c0c85518 Mon Sep 17 00:00:00 2001 From: Abdel-Monaam-Aouini Date: Thu, 23 Mar 2023 16:58:32 +0100 Subject: [PATCH 05/11] test another tool --- .github/workflows/pr.yml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 8a1c108f..4c3fd6c1 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -104,17 +104,7 @@ jobs: runs-on: ubuntu-latest needs: [deploy] steps: - - id: automerge - name: automerge - uses: "pascalgn/automerge-action@v0.15.6" - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - LOG: "TRACE" # or "DEBUG" - MERGE_LABELS: "automerge,!work in progress" - MERGE_REMOVE_LABELS: "automerge" - MERGE_METHOD: "squash" - MERGE_REQUIRED_APPROVALS: "0" - - name: feedback - if: steps.automerge.outputs.mergeResult == '"merged"' - run: | - echo "Pull request ${{ steps.automerge.outputs.pullRequestNumber }} merged!" + - uses: alexwilson/enable-github-automerge-action@1.0.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + merge-method: "SQUASH" From 88c120612252a5f6a64da669790daa89d91388f3 Mon Sep 17 00:00:00 2001 From: Abdel-Monaam-Aouini Date: Thu, 23 Mar 2023 17:02:05 +0100 Subject: [PATCH 06/11] checkout --- .github/workflows/pr.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4c3fd6c1..4135e80e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -104,7 +104,10 @@ jobs: runs-on: ubuntu-latest needs: [deploy] steps: - - uses: alexwilson/enable-github-automerge-action@1.0.0 + - name: Checkout + uses: actions/checkout@v3 + - name: Enable auto-merge + uses: alexwilson/enable-github-automerge-action@1.0.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" merge-method: "SQUASH" From 7ebc32d791f452c63d98070d58b730d2a61ab41f Mon Sep 17 00:00:00 2001 From: Abdel-Monaam-Aouini Date: Thu, 23 Mar 2023 17:06:17 +0100 Subject: [PATCH 07/11] :) --- .github/workflows/pr.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4135e80e..b9a0366d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -104,10 +104,8 @@ jobs: runs-on: ubuntu-latest needs: [deploy] steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Enable auto-merge - uses: alexwilson/enable-github-automerge-action@1.0.0 + - uses: actions/checkout@v3 + - uses: emiliopedrollo/auto-merge@v1.2.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" - merge-method: "SQUASH" + commit_message: 'Branch {target_branch} auto-merged {source_ref}' \ No newline at end of file From b953eb8537006a3fbf10543250bc06e49037beb3 Mon Sep 17 00:00:00 2001 From: Abdel-Monaam-Aouini Date: Thu, 23 Mar 2023 17:08:21 +0100 Subject: [PATCH 08/11] fix github token --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b9a0366d..3133352d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -107,5 +107,5 @@ jobs: - uses: actions/checkout@v3 - uses: emiliopedrollo/auto-merge@v1.2.0 with: - github-token: "${{ secrets.GITHUB_TOKEN }}" + github_token: "${{ secrets.GITHUB_TOKEN }}" commit_message: 'Branch {target_branch} auto-merged {source_ref}' \ No newline at end of file From d1d1e01c7c512f44393552adcaafb99f21df0403 Mon Sep 17 00:00:00 2001 From: Abdel-Monaam-Aouini Date: Thu, 23 Mar 2023 17:12:08 +0100 Subject: [PATCH 09/11] fix permission --- .github/workflows/pr.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 3133352d..34744a8a 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -12,9 +12,10 @@ on: # Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages permissions: - contents: read + contents: write pages: write id-token: write + pull_request: write jobs: style: @@ -98,14 +99,4 @@ jobs: run: gh pr merge --auto --squash "$PR_URL" env: PR_URL: ${{ github.event.pull_request.html_url }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - automerge: - runs-on: ubuntu-latest - needs: [deploy] - steps: - - uses: actions/checkout@v3 - - uses: emiliopedrollo/auto-merge@v1.2.0 - with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - commit_message: 'Branch {target_branch} auto-merged {source_ref}' \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 25f11a7b80bd0f8ce928007143d643f9c9756ea1 Mon Sep 17 00:00:00 2001 From: Abdel-Monaam-Aouini Date: Thu, 23 Mar 2023 17:14:16 +0100 Subject: [PATCH 10/11] :) --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 34744a8a..fcb06d93 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -15,7 +15,7 @@ permissions: contents: write pages: write id-token: write - pull_request: write + pull_requests: write jobs: style: From 0a99076293dc5517da86ae46122537bba82c5472 Mon Sep 17 00:00:00 2001 From: Abdel-Monaam-Aouini Date: Thu, 23 Mar 2023 17:16:28 +0100 Subject: [PATCH 11/11] fix:! --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index fcb06d93..86ca845d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -15,7 +15,7 @@ permissions: contents: write pages: write id-token: write - pull_requests: write + pull-requests: write jobs: style: