-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Add automerge github shared workflow (#55)
Co-authored-by: Anmol Nagpal <anmol@clouddrove.com>
- Loading branch information
1 parent
c7230fb
commit fb80df2
Showing
6 changed files
with
16 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,12 @@ | ||
name: Auto approve and merge PRs by dependabot | ||
--- | ||
name: Auto merge | ||
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]' | ||
steps: | ||
- name: Wait for "tflint" to succeed | ||
uses: lewagon/wait-on-check-action@v1.0.0 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
check-name: 'tf-lint / tflint' | ||
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}} | ||
|
||
- 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/automerge-action@v0.15.6 | ||
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: "" | ||
auto-merge: | ||
uses: clouddrove/github-shared-workflows/.github/workflows/auto_merge.yml@1.0.9 | ||
secrets: | ||
GITHUB: ${{ secrets.GITHUB }} | ||
with: | ||
tfcheck: '_example / Check code format' | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters