Skip to content

feat: update workflows added merge labels #1019

feat: update workflows added merge labels

feat: update workflows added merge labels #1019

Workflow file for this run

---
name: Automerge
on:
pull_request:
inputs:
tfcheck:
description: 'Enter the tfcheck action name.'
required: false
type: string
secrets:
GITHUB:
description: 'GitHub Token'
required: false
jobs:
static-checks:
name: Check Static Analysis
runs-on: ubuntu-latest
strategy:
matrix:
tf-checks: ["tf-lint / tflint", "tfsec / tfsec sarif report", "${{ inputs.tfcheck }}"]
if: github.actor == 'dependabot[bot]'
steps:
- name: Wait for 2 Minutes
run: sleep 120s
shell: bash
- name: Wait for "${{ matrix.tf-checks }}" to Succeed
uses: lewagon/wait-on-check-action@v1.3.3
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: ${{ matrix.tf-checks }}
repo-token: ${{ secrets.GITHUB }}
wait-interval: 30
allowed-conclusions: success
autoapprove:
permissions:
contents: write
pull-requests: write
name: Auto Approve PRs by Dependabot
needs: static-checks
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Approve a PR for Github Bot
if: ${{steps.get-status.outputs.all-checks-completed == 'true' && steps.get-status.outputs.all-checks-passed == 'true'}}
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Approve PR via 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:
- name: Automerge
uses: pascalgn/automerge-action@v0.16.2
if: github.event_name == 'pull_request' && github.event.pull_request.draft == false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MERGE_FILTER_AUTHOR: 'dependabot[bot]'
MERGE_METHOD: "merge"
MERGE_DELETE_BRANCH: "true"
MERGE_LABELS: "dependencies,automerge"
MERGE_REQUIRED_APPROVALS: ""
...