From fb80df2626b94e91e735a47a0cc9ce5986211d50 Mon Sep 17 00:00:00 2001 From: Vaibhav Bhagwat Pendhare Date: Wed, 27 Dec 2023 23:44:46 +0530 Subject: [PATCH] Feat: Add automerge github shared workflow (#55) Co-authored-by: Anmol Nagpal --- .github/workflows/auto_assignee.yml | 2 +- .github/workflows/automerge.yml | 61 +++++------------------------ .github/workflows/changelog.yml | 2 +- .github/workflows/tf-checks.yml | 6 +-- .github/workflows/tflint.yml | 2 +- .github/workflows/tfsec.yml | 2 +- 6 files changed, 16 insertions(+), 59 deletions(-) diff --git a/.github/workflows/auto_assignee.yml b/.github/workflows/auto_assignee.yml index 3dbedbd..445106d 100644 --- a/.github/workflows/auto_assignee.yml +++ b/.github/workflows/auto_assignee.yml @@ -5,7 +5,7 @@ on: workflow_dispatch: jobs: assignee: - uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@1.0.5 + uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@1.0.9 secrets: GITHUB: ${{ secrets.GITHUB }} with: diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index ad0f55d..ee45a45 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -1,55 +1,12 @@ -name: Auto approve and merge PRs by dependabot +--- +name: Auto merge on: pull_request: - -permissions: - contents: write - pull-requests: write - jobs: - static-checks: - name: Check the status of static checks - runs-on: ubuntu-latest - if: github.actor == 'dependabot[bot]' - steps: - - name: Wait for "tflint" to succeed - uses: lewagon/wait-on-check-action@v1.0.0 - with: - ref: ${{ github.event.pull_request.head.sha }} - check-name: 'tf-lint / tflint' - repo-token: ${{ secrets.GITHUB }} - wait-interval: 30 - - 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 - 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 - needs: autoapprove - steps: - - id: automerge - name: automerge - uses: pascalgn/automerge-action@v0.15.6 - if: github.event_name == 'pull_request' && github.event.pull_request.draft == false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB }} - MERGE_FILTER_AUTHOR: 'dependabot[bot]' - MERGE_METHOD: "merge" - MERGE_DELETE_BRANCH: "true" - MERGE_LABELS: "dependencies" - MERGE_REQUIRED_APPROVALS: "" + auto-merge: + uses: clouddrove/github-shared-workflows/.github/workflows/auto_merge.yml@1.0.9 + secrets: + GITHUB: ${{ secrets.GITHUB }} + with: + tfcheck: '_example / Check code format' +... diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index af14ff7..b3d9eb2 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: changelog: - uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@1.0.5 + uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@1.0.9 secrets: inherit with: branch: 'master' diff --git a/.github/workflows/tf-checks.yml b/.github/workflows/tf-checks.yml index 92183e5..4109d7f 100644 --- a/.github/workflows/tf-checks.yml +++ b/.github/workflows/tf-checks.yml @@ -6,14 +6,14 @@ on: workflow_dispatch: jobs: tf-checks-anomaly-example: - uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.5 + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.9 with: working_directory: './_example/anomaly_example/' tf-checks-basic-example: - uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.5 + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.9 with: working_directory: './_example/basic_example/' tf-checks-expression-example: - uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.5 + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.9 with: working_directory: './_example/expression_example/' diff --git a/.github/workflows/tflint.yml b/.github/workflows/tflint.yml index a92aebb..0875a68 100644 --- a/.github/workflows/tflint.yml +++ b/.github/workflows/tflint.yml @@ -6,6 +6,6 @@ on: workflow_dispatch: jobs: tf-lint: - uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@1.0.5 + uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@1.0.9 secrets: GITHUB: ${{ secrets.GITHUB }} diff --git a/.github/workflows/tfsec.yml b/.github/workflows/tfsec.yml index 5c27fb9..daefede 100644 --- a/.github/workflows/tfsec.yml +++ b/.github/workflows/tfsec.yml @@ -5,7 +5,7 @@ on: workflow_dispatch: jobs: tfsec: - uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@1.0.5 + uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@1.0.9 secrets: inherit with: working_directory: '.'