From ddcf5e697cca71ca6a5c3e4ee83fb276ad4fd5b4 Mon Sep 17 00:00:00 2001 From: Anmol Nagpal Date: Tue, 5 Dec 2023 16:23:27 +0530 Subject: [PATCH 1/2] Feat: update the automerge workflow --- .github/workflows/automerge.yml | 44 +++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/automerge.yml diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 0000000..5cce1ef --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,44 @@ +name: Auto approve and merge PRs by dependabot +on: + pull_request: + types: + - synchronize + - opened + - reopened + +permissions: + contents: write + pull-requests: write + +jobs: + autoapprove: + name: Auto Approve a PR by dependabot + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' && success() && github.event_name == 'pull_request' + 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 + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB}} + + automerge: + runs-on: ubuntu-latest + steps: + - id: automerge + name: automerge + uses: pascalgn/automerge-action@v0.15.6 + if: github.event_name == 'pull_request' && github.event.action == 'synchronize' && github.event.pull_request.draft == false && success() + env: + GITHUB_TOKEN: ${{ secrets.GITHUB }} + MERGE_FILTER_AUTHOR: 'dependabot[bot]' + MERGE_METHOD: "merge" + MERGE_DELETE_BRANCH: "true" + MERGE_LABELS: "dependencies" + MERGE_REQUIRED_APPROVALS: "" From 8c24c4c3d23b9544b7892ff72fe6b22cd4ad31b3 Mon Sep 17 00:00:00 2001 From: Anmol Nagpal Date: Tue, 5 Dec 2023 16:28:59 +0530 Subject: [PATCH 2/2] Feat: update the automerge workflow --- .github/workflows/automerge.yml | 3 ++- .github/workflows/tflint.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 5cce1ef..e428d9a 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -29,7 +29,8 @@ jobs: GITHUB_TOKEN: ${{secrets.GITHUB}} automerge: - runs-on: ubuntu-latest + runs-on: ubuntu-latest + needs: autoapprove steps: - id: automerge name: automerge diff --git a/.github/workflows/tflint.yml b/.github/workflows/tflint.yml index 63ffe5b..3eafee9 100644 --- a/.github/workflows/tflint.yml +++ b/.github/workflows/tflint.yml @@ -6,6 +6,6 @@ on: workflow_dispatch: jobs: tf-lint: - uses: clouddrove/test-tfsec/.github/workflows/tflint.yaml@1.0.6 + uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@1.0.8 secrets: GITHUB: ${{ secrets.GITHUB }}