Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/automerge #56

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b2d2677
Feat: update the automerge workflow for static checks
anmolnagpal Dec 5, 2023
a3b67f8
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
28316bc
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
05b6e0e
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
6c8c985
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
937df05
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
d5350c5
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
eb6d4ee
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
96d7a2e
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
707569b
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
c639c93
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
cbfcb41
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
068f03a
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
eca51e9
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
80eb4ec
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
678aaa3
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
eaabfd1
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
f458fc7
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
15919c2
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
8b8428e
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
2250da3
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
519de86
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
1666780
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
9336387
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
625b8ed
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
b199cdb
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
07a836c
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
319bd8f
Feat: update the automerge workflow
anmolnagpal Dec 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 45 additions & 34 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,57 @@ jobs:
static-checks:
name: Check the status of static checks
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
strategy:
matrix:
tf-checks: ["tflint-check / tflint", "tfsec / tfsec sarif report"]
# if: github.actor == 'dependabot[bot]'
steps:
- name: Wait for "tflint" to succeed
# - name: Wait for "tfsec" to succeed
# uses: lewagon/[email protected]
# with:
# ref: ${{ github.event.pull_request.head.sha }}
# check-name: 'tflint-check / tflint'
# repo-token: ${{ secrets.GITHUB }}
# wait-interval: 30

- name: Wait for "${{ matrix.tf-checks }}" to succeed
uses: lewagon/[email protected]
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: 'tf-lint / tflint'
check-name: ${{ matrix.tf-checks }}
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}}
# 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}}
# - 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: ""
# 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: ""
2 changes: 1 addition & 1 deletion .github/workflows/tf-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ jobs:
with:
working_directory: './_example/s3-replication/'
tf-checks-website-s3-example:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.7
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@feat/tfcheckUpdate
with:
working_directory: './_example/website-s3/'
1 change: 1 addition & 0 deletions .github/workflows/tflint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
workflow_dispatch:
jobs:
tf-lint:
name: tflint-check
uses: clouddrove/github-shared-workflows/.github/workflows/[email protected]
secrets:
GITHUB: ${{ secrets.GITHUB }}