Skip to content

Commit

Permalink
Merge pull request #46 from clouddrove/feature/automerge
Browse files Browse the repository at this point in the history
Feat: update the automerge workflow and tflint workflow.
  • Loading branch information
vaibhav7797 authored Dec 5, 2023
2 parents 2669a38 + 8c24c4c commit 39e4202
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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
needs: autoapprove
steps:
- id: automerge
name: automerge
uses: pascalgn/[email protected]
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: ""
2 changes: 1 addition & 1 deletion .github/workflows/tflint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit 39e4202

Please sign in to comment.