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: approve and merge automatic PRs #239

Merged
merged 2 commits into from
Aug 27, 2024
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
24 changes: 24 additions & 0 deletions .github/workflows/automerge_dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Auto-merge Dependabot
on: pull_request

permissions:
pull-requests: write
contents: write

jobs:
automerge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:

- name: Enable Automerge
if: steps.pull-request.outputs.pull-request-operation == 'created'
run: gh pr merge --merge --auto "${{ github.event.pull_request.number }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Approve
if: steps.pull-request.outputs.pull-request-operation == 'created'
run: gh pr review --approve "${{ github.event.pull_request.number }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 8 additions & 17 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,23 +133,14 @@ jobs:
branch: create-pull-request/bump
delete-branch: true

- uses: tibdex/github-app-token@v2
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Enable Pull Request Automerge
- name: Enable Automerge
if: steps.pull-request.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v3
with:
token: ${{ steps.generate-token.outputs.token }}
pull-request-number: ${{ steps.pull-request.outputs.pull-request-number }}
merge-method: squash
run: gh pr merge --merge --auto "${{ steps.pull-request.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Auto approve
- name: Approve
if: steps.pull-request.outputs.pull-request-operation == 'created'
uses: juliangruber/approve-pull-request-action@v2
with:
github-token: ${{ steps.generate-token.outputs.token }}
number: ${{ steps.pull-request.outputs.pull-request-number }}
run: gh pr review --approve "${{ steps.pull-request.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}