Skip to content

Feature/automerge

Feature/automerge #13

Workflow file for this run

name: Auto approve and merge PRs by dependabot
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]'
strategy:
matrix:
tf-checks: ["tf-lint / tflint"]
steps:
- name: Wait for "${{ matrix.tf-checks }}" to succeed
uses: lewagon/[email protected]
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: ${{ matrix.tf-checks }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
# 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/[email protected]
# 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: ""