From 1d833b812c8914aa585ee95d59194223cb6fb7f6 Mon Sep 17 00:00:00 2001 From: Anmol Nagpal Date: Tue, 5 Dec 2023 19:30:50 +0530 Subject: [PATCH 01/15] Feat: update the automerge workflow for static checks --- .github/workflows/automerge.yml | 37 +++++++++++++++++---------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 4f7890d..a9371cb 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -7,34 +7,35 @@ permissions: pull-requests: write jobs: - autoapprove: + static-checks: name: Auto Approve a PR by dependabot runs-on: ubuntu-latest - if: github.actor == 'dependabot[bot]' + if: github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'dependencies' + strategy: + matrix: + tf-checks: ["tf-lint", "tfsec", "tf-checks"] steps: - - name: wait for other checks to complete - run: | - sleep 150 - - - name: Get Status of current PR - id: get-status - uses: danieldeichfuss/get-status@v0.0.10 - with: - ref: ${{ github.sha }} - - - uses: dominikh/staticcheck-action@v1.3.0 + - name: Wait for "${{ matrix.tf-checks }}" to succeed + uses: lewagon/wait-on-check-action@v1.0.0 with: - version: "2022.1.3" + ref: ${{ github.event.pull_request.head.sha }} + check-name: ${{ matrix.tf-checks }} + repo-token: ${{ secrets.GITHUB_TOKEN }} + wait-interval: 10 - - name: Approve a PR for Github Bot - if: ${{steps.get-status.outputs.all-checks-completed == 'true' && steps.get-status.outputs.all-checks-passed == 'true'}} + autoapprove: + name: Auto Approve a PR by dependabot + needs: static-checks + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' + steps: + - name: Approve a PR for Github Bot run: gh pr review --approve "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - name: Approve a PR for Anmol nagpal - if: ${{steps.get-status.outputs.all-checks-completed == 'true' && steps.get-status.outputs.all-checks-passed == 'true'}} + - name: Approve a PR for Anmol nagpal run: gh pr review --approve "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} From c233de1a4f5984cd1fca79806f6f3abdb155e290 Mon Sep 17 00:00:00 2001 From: Anmol Nagpal Date: Tue, 5 Dec 2023 20:24:52 +0530 Subject: [PATCH 02/15] Feat: update the automerge workflow for static checks --- .github/workflows/automerge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index a9371cb..9c17118 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -10,7 +10,7 @@ jobs: static-checks: name: Auto Approve a PR by dependabot runs-on: ubuntu-latest - if: github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'dependencies' + if: github.actor == 'dependabot[bot]' strategy: matrix: tf-checks: ["tf-lint", "tfsec", "tf-checks"] From 6bc4c41e0ade0db9209737bc357964c9db5a3ee8 Mon Sep 17 00:00:00 2001 From: Anmol Nagpal Date: Tue, 5 Dec 2023 20:44:34 +0530 Subject: [PATCH 03/15] Feat: update the automerge workflow for static checks --- .github/workflows/automerge.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 9c17118..e1c3832 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -8,7 +8,7 @@ permissions: jobs: static-checks: - name: Auto Approve a PR by dependabot + name: Check the status of static checks runs-on: ubuntu-latest if: github.actor == 'dependabot[bot]' strategy: @@ -18,7 +18,7 @@ jobs: - name: Wait for "${{ matrix.tf-checks }}" to succeed uses: lewagon/wait-on-check-action@v1.0.0 with: - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ github.sha }}:${{ github.event.pull_request.head.sha }} check-name: ${{ matrix.tf-checks }} repo-token: ${{ secrets.GITHUB_TOKEN }} wait-interval: 10 From 867023a21a0f07965794cd0e72a7c51208f690a6 Mon Sep 17 00:00:00 2001 From: Anmol Nagpal Date: Tue, 5 Dec 2023 21:03:17 +0530 Subject: [PATCH 04/15] Feat: update the automerge workflow for static checks --- .github/workflows/automerge.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index e1c3832..7fab10e 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -15,12 +15,15 @@ jobs: matrix: tf-checks: ["tf-lint", "tfsec", "tf-checks"] steps: + - name: 'Checkout' + id: checkout + uses: actions/checkout@v2.3.4 - name: Wait for "${{ matrix.tf-checks }}" to succeed uses: lewagon/wait-on-check-action@v1.0.0 with: - ref: ${{ github.sha }}:${{ github.event.pull_request.head.sha }} + ref: ${{ github.event.pull_request.head.sha }} check-name: ${{ matrix.tf-checks }} - repo-token: ${{ secrets.GITHUB_TOKEN }} + repo-token: ${{ secrets.GITHUB }} wait-interval: 10 autoapprove: From b32ef47b9222d2a1cad13075e8dc52b1e475a07f Mon Sep 17 00:00:00 2001 From: Anmol Nagpal Date: Tue, 5 Dec 2023 21:13:33 +0530 Subject: [PATCH 05/15] Feat: update the automerge workflow for static checks --- .github/workflows/automerge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 7fab10e..07d7edc 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -13,7 +13,7 @@ jobs: if: github.actor == 'dependabot[bot]' strategy: matrix: - tf-checks: ["tf-lint", "tfsec", "tf-checks"] + tf-checks: ["tflint"] steps: - name: 'Checkout' id: checkout From bb8e1e85b1b9f5a6ac1a73a86660c0cac94a596b Mon Sep 17 00:00:00 2001 From: Anmol Nagpal Date: Tue, 5 Dec 2023 21:18:01 +0530 Subject: [PATCH 06/15] Feat: update the automerge workflow for static checks --- .github/workflows/automerge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index d4dfcee..d4ab30b 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -21,7 +21,7 @@ jobs: - name: Wait for "${{ matrix.tf-checks }}" to succeed uses: lewagon/wait-on-check-action@v1.0.0 with: - ref: ${{ github.sha }}:${{ github.event.pull_request.head.sha }} + ref: ${{ github.sha }} check-name: ${{ matrix.tf-checks }} repo-token: ${{ secrets.GITHUB }} wait-interval: 10 From ea517dc77667e30b9e18e47f2a3949a9cb2b5ffe Mon Sep 17 00:00:00 2001 From: Anmol Nagpal Date: Tue, 5 Dec 2023 22:06:01 +0530 Subject: [PATCH 07/15] Feat: update the automerge workflow for static checks --- .github/workflows/automerge.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index d4ab30b..31ab5c4 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -1,7 +1,7 @@ name: Auto approve and merge PRs by dependabot on: pull_request: - + types: [opened,synchronize,reopened] permissions: contents: write pull-requests: write @@ -21,7 +21,7 @@ jobs: - name: Wait for "${{ matrix.tf-checks }}" to succeed uses: lewagon/wait-on-check-action@v1.0.0 with: - ref: ${{ github.sha }} + ref: ${{ github.event.pull_request.head.sha }} check-name: ${{ matrix.tf-checks }} repo-token: ${{ secrets.GITHUB }} wait-interval: 10 From 09e9c36e68c7a4e2052d0a63ed25e174adf8e6b5 Mon Sep 17 00:00:00 2001 From: Anmol Nagpal Date: Tue, 5 Dec 2023 22:07:42 +0530 Subject: [PATCH 08/15] Feat: update the automerge workflow for static checks --- .github/workflows/automerge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 31ab5c4..8110be9 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -1,7 +1,7 @@ name: Auto approve and merge PRs by dependabot on: pull_request: - types: [opened,synchronize,reopened] + types: [opened,synchronize] permissions: contents: write pull-requests: write From 1a9d497f8e1f23aa297328841a20fc2bf6cfe19c Mon Sep 17 00:00:00 2001 From: Anmol Nagpal Date: Tue, 5 Dec 2023 22:17:46 +0530 Subject: [PATCH 09/15] Feat: update the automerge workflow for static checks --- .github/workflows/automerge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 8110be9..73f260f 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -21,7 +21,7 @@ jobs: - name: Wait for "${{ matrix.tf-checks }}" to succeed uses: lewagon/wait-on-check-action@v1.0.0 with: - ref: ${{ github.event.pull_request.head.sha }} + ref: master check-name: ${{ matrix.tf-checks }} repo-token: ${{ secrets.GITHUB }} wait-interval: 10 From eb47811e4f80de7e74f931144c656859872453bc Mon Sep 17 00:00:00 2001 From: Anmol Nagpal Date: Tue, 5 Dec 2023 22:28:39 +0530 Subject: [PATCH 10/15] Feat: update the automerge workflow for static checks --- .github/workflows/automerge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 73f260f..cab14de 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -21,7 +21,7 @@ jobs: - name: Wait for "${{ matrix.tf-checks }}" to succeed uses: lewagon/wait-on-check-action@v1.0.0 with: - ref: master + ref: ${{ github.ref }} check-name: ${{ matrix.tf-checks }} repo-token: ${{ secrets.GITHUB }} wait-interval: 10 From cf6e2deab351b99d7c1479731d6b965a2275f905 Mon Sep 17 00:00:00 2001 From: Anmol Nagpal Date: Tue, 5 Dec 2023 22:41:32 +0530 Subject: [PATCH 11/15] Feat: update the automerge workflow for static checks --- .github/workflows/automerge.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index cab14de..273aeef 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -10,20 +10,14 @@ jobs: static-checks: name: Check the status of static checks runs-on: ubuntu-latest - if: github.actor == 'dependabot[bot]' - strategy: - matrix: - tf-checks: ["tflint"] + if: github.actor == 'dependabot[bot]' steps: - - name: 'Checkout' - id: checkout - uses: actions/checkout@v2.3.4 - - name: Wait for "${{ matrix.tf-checks }}" to succeed + - name: Wait for "tflint" to succeed uses: lewagon/wait-on-check-action@v1.0.0 with: - ref: ${{ github.ref }} - check-name: ${{ matrix.tf-checks }} - repo-token: ${{ secrets.GITHUB }} + ref: ${{ github.event.pull_request.head.sha }} + check-name: 'tf-lint' + repo-token: ${{ secrets.GITHUB_TOKEN }} wait-interval: 10 autoapprove: From 77dffd7e05cfedafe6c8f28505474e7cc08f41ca Mon Sep 17 00:00:00 2001 From: Anmol Nagpal Date: Tue, 5 Dec 2023 22:46:38 +0530 Subject: [PATCH 12/15] Feat: update the automerge workflow for static checks --- .github/workflows/automerge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 273aeef..611bf4c 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -16,7 +16,7 @@ jobs: uses: lewagon/wait-on-check-action@v1.0.0 with: ref: ${{ github.event.pull_request.head.sha }} - check-name: 'tf-lint' + check-name: 'tflint' repo-token: ${{ secrets.GITHUB_TOKEN }} wait-interval: 10 From a4f369ff48970b044947d7b90cd1fffc115439be Mon Sep 17 00:00:00 2001 From: Anmol Nagpal Date: Tue, 5 Dec 2023 23:23:02 +0530 Subject: [PATCH 13/15] Feat: update the automerge workflow for static checks --- .github/workflows/automerge.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 611bf4c..cc90329 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -1,7 +1,7 @@ name: Auto approve and merge PRs by dependabot on: pull_request: - types: [opened,synchronize] + permissions: contents: write pull-requests: write @@ -16,9 +16,9 @@ jobs: uses: lewagon/wait-on-check-action@v1.0.0 with: ref: ${{ github.event.pull_request.head.sha }} - check-name: 'tflint' - repo-token: ${{ secrets.GITHUB_TOKEN }} - wait-interval: 10 + check-name: 'tf-lint' + repo-token: ${{ secrets.GITHUB }} + wait-interval: 30 autoapprove: name: Auto Approve a PR by dependabot @@ -26,13 +26,13 @@ jobs: runs-on: ubuntu-latest if: github.actor == 'dependabot[bot]' steps: - - name: Approve a PR for Github Bot + - name: Approve a PR for Github Bot run: gh pr review --approve "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - name: Approve a PR for Anmol nagpal + - name: Approve a PR for Anmol nagpal run: gh pr review --approve "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} From 6194be3d8187bbe4ed65eeb46c243eace451208b Mon Sep 17 00:00:00 2001 From: Anmol Nagpal Date: Tue, 5 Dec 2023 23:38:21 +0530 Subject: [PATCH 14/15] Feat: update the automerge workflow for static checks --- .github/workflows/automerge.yml | 4 ++-- .github/workflows/test.yml | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index cc90329..373ee81 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -12,11 +12,11 @@ jobs: runs-on: ubuntu-latest if: github.actor == 'dependabot[bot]' steps: - - name: Wait for "tflint" to succeed + - name: Wait for "testing" to succeed uses: lewagon/wait-on-check-action@v1.0.0 with: ref: ${{ github.event.pull_request.head.sha }} - check-name: 'tf-lint' + check-name: 'Static test checks' repo-token: ${{ secrets.GITHUB }} wait-interval: 30 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..2823f12 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,12 @@ +name: test +on: + pull_request: + +jobs: + static-checks: + name: 'Static test checks' + runs-on: ubuntu-20.04 + steps: + - name: Sleep for 60 seconds + run: sleep 60s + shell: bash From dd5f7081016d88b701f5c0baed167a59e6ded027 Mon Sep 17 00:00:00 2001 From: Anmol Nagpal Date: Tue, 5 Dec 2023 23:47:25 +0530 Subject: [PATCH 15/15] Feat: update the automerge workflow for static checks --- .github/workflows/automerge.yml | 2 +- .github/workflows/test.yml | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 373ee81..b444f73 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -16,7 +16,7 @@ jobs: uses: lewagon/wait-on-check-action@v1.0.0 with: ref: ${{ github.event.pull_request.head.sha }} - check-name: 'Static test checks' + check-name: 'tf-lint / tflint' repo-token: ${{ secrets.GITHUB }} wait-interval: 30 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 2823f12..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: test -on: - pull_request: - -jobs: - static-checks: - name: 'Static test checks' - runs-on: ubuntu-20.04 - steps: - - name: Sleep for 60 seconds - run: sleep 60s - shell: bash