Skip to content

Commit

Permalink
chore: Auto merge PR from otto-the-bot and dependabot (#16616)
Browse files Browse the repository at this point in the history
* chore: Auto merge PR from otto-the-bot and dependabot

* removeme

* fix config

* fixup
  • Loading branch information
atomrc authored Jan 24, 2024
1 parent 2ab1c76 commit 7f41783
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 44 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/cherry-pick-release-to-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,4 @@ jobs:
with:
pr_branch: 'dev'
env:
GITHUB_TOKEN: ${{ secrets.OTTO_THE_BOT_GH_TOKEN }}

# Add the auto-merge flag
- name: Enable auto-merge
run: gh pr edit ${{ github.event.pull_request.id }} --add-label auto-merge
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{secrets.OTTO_THE_BOT_GH_TOKEN}}
25 changes: 0 additions & 25 deletions .github/workflows/dependabot-auto-merge.yml

This file was deleted.

18 changes: 7 additions & 11 deletions .github/workflows/pr-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
name: auto-merge flagged PR
on:
pull_request:
types: ['labeled']
name: auto-merge PR
on: pull_request

permissions:
pull-requests: write
contents: write

## This job will auto merge PR that has been labeled with 'auto-merge'
# This job will enable auto merge on dependabots and otto-the-bot's PRs
jobs:
activate-auto-merge:
runs-on: ubuntu-latest
if: ${{ github.event.label.name == 'auto-merge' }}
if: ${{github.actor == 'dependabot[bot]' || github.actor == 'otto-the-bot'}}
steps:
- name: Approve PR
run: gh pr review --approve "$PR_URL"
run: gh pr review --approve ${{github.event.pull_request.html_url}}
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Enable auto-merge
run: gh pr merge --auto --squash "$PR_URL"
run: gh pr merge --auto --squash ${{github.event.pull_request.html_url}}
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.WEBTEAM_AUTOMERGE_TOKEN}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 comments on commit 7f41783

Please sign in to comment.