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

chore: make sure auto-approve and automerge work for Dependabot #27

Merged
merged 3 commits into from
Oct 19, 2023
Merged
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
53 changes: 33 additions & 20 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,40 @@ updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
interval: "weekly"
labels:
- "dependencies"
- "automerge"
- "auto-approve"
- "dependencies"
- "automerge"
- "auto-approve"
open-pull-requests-limit: 5
ignore:
- dependency-name: "@types/node"
- dependency-name: "@types/node"
# For providers, ignore all patch updates for version updates only
- dependency-name: "@cdktf/provider-aws"
update-types: ["version-update:semver-patch"]
- dependency-name: "@cdktf/provider-local"
update-types: ["version-update:semver-patch"]
groups:
cdktf:
patterns:
- "cdktf"
- "cdktf-cli"
- "@cdktf/*"
jest:
patterns:
- "jest"
- "ts-jest"
- "@types/jest"
- "@jest/*"




cdktf:
patterns:
- "cdktf"
- "cdktf-cli"
- "@cdktf/*"
jest:
patterns:
- "jest"
- "ts-jest"
- "@types/jest"
- "@jest/*"
- package-ecosystem: npm
versioning-strategy: lockfile-only
directory: /frontend/code
schedule:
interval: daily
labels:
- auto-approve
- automerge
- dependencies
- security
# Disable version updates for npm dependencies, only use Dependabot for security updates
open-pull-requests-limit: 0
12 changes: 6 additions & 6 deletions .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Auto-approve PRs by other users as team-tf-cdk
if: github.event.pull_request.user.login != 'team-tf-cdk'
if: github.event.pull_request.user.login != 'team-tf-cdk' && github.actor != 'dependabot[bot]'
env:
GH_TOKEN: ${{ secrets.TEAM_TF_CDK }}
GH_TOKEN: ${{ secrets.TEAM_TF_CDK }}
run: gh pr review ${{ github.event.pull_request.number }} --approve
- name: Auto-approve PRs by team-tf-cdk as github-actions[bot]
if: github.event.pull_request.user.login == 'team-tf-cdk'
- name: Auto-approve PRs by team-tf-cdk or Dependabot as github-actions[bot]
if: github.event.pull_request.user.login == 'team-tf-cdk' || github.actor == 'dependabot[bot]'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token does not need to be replaced
run: gh pr review ${{ github.event.pull_request.number }} --approve
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr review ${{ github.event.pull_request.number }} --approve
11 changes: 9 additions & 2 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
if: contains(github.event.pull_request.labels.*.name, 'automerge') && github.event.pull_request.draft == false
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Turn on automerge for this PR
- name: Turn on automerge for this PR by Dependabot
if: github.actor == 'dependabot[bot]'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr merge --auto --squash ${{ github.event.pull_request.number }}
- name: Turn on automerge for this PR by users other than Dependabot
if: github.actor != 'dependabot[bot]'
env:
GH_TOKEN: ${{ secrets.TEAM_TF_CDK }}
GH_TOKEN: ${{ secrets.TEAM_TF_CDK }}
run: gh pr merge --auto --squash ${{ github.event.pull_request.number }}