Skip to content

Commit

Permalink
Add automerge for pre-commit & change CODEOWNERS
Browse files Browse the repository at this point in the history
  • Loading branch information
laurensWe committed Jun 18, 2024
1 parent 07afd0b commit 2337dd6
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
* @MinBZK/ai-validation-team

# excluded files so github actions bot can auto update dependencies
# see https://github.com/orgs/community/discussions/23064
poetry.lock
pyproject.toml
.github/workflows/*
.devcontainer/devcontainer.json
.pre-commit-config.yaml
27 changes: 24 additions & 3 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: AutoMerge
name: Dependabot & Pre-Commit auto-merge
on: pull_request


jobs:
automerge:
automerge-dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
permissions:
Expand All @@ -23,9 +23,30 @@ jobs:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Enable auto-merge for Dependabot PRs
- name: Enable Auto-Merge for Dependabot PRs
if: steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

automerge-pre-commit:
runs-on: ubuntu-latest
if: github.actor == 'pre-commit-ci[bot]'
permissions:
contents: write
pull-requests: write
steps:
- name: Enable Auto-Approve for Pre-Commit
if: github.head_ref == 'pre-commit-ci-update-config'
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Enable Auto-Merge for Pre-Commit
if: github.head_ref == 'pre-commit-ci-update-config'
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ __pypackages__/

# ruff linter
.ruff_cache/


# PyCharm files
.idea/

0 comments on commit 2337dd6

Please sign in to comment.