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/auto merge #60

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions .github/workflows/automerge-caller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Auto merge
on:
pull_request:
jobs:
assignee:
uses: clouddrove/github-shared-workflows/.github/workflows/automerge.yml@feature/autoMergeTest
secrets:
GITHUB: ${{ secrets.GITHUB }}
with:
tfcheck: 'tf-checks-website-s3-example / Get min/max versions'
106 changes: 53 additions & 53 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
name: Auto approve and merge PRs by dependabot
on:
pull_request:
# name: Auto approve and merge PRs by dependabot
# on:
# pull_request:

permissions:
contents: write
pull-requests: write
# permissions:
# contents: write
# pull-requests: write

jobs:
static-checks:
name: Check the status of static checks
runs-on: ubuntu-latest
strategy:
matrix:
tf-checks: ["tf-lint / tflint", "tfsec / tfsec sarif report", "tf-checks-website-s3-example / Get min/max versions"]
if: github.actor == 'dependabot[bot]'
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 }}
wait-interval: 30
# jobs:
# static-checks:
# name: Check the status of static checks
# runs-on: ubuntu-latest
# strategy:
# matrix:
# tf-checks: ["tf-lint / tflint", "tfsec / tfsec sarif report", "tf-checks-website-s3-example / Get min/max versions"]
# if: github.actor == 'dependabot[bot]'
# 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 }}
# 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 @@ -36,4 +36,4 @@ jobs:
tf-checks-website-s3-example:
uses: clouddrove/github-shared-workflows/.github/workflows/[email protected]
with:
working_directory: './_example/website-s3/'
working_directory: './_example/website-s3/'