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: Auto merge PR from otto-the-bot and dependabot #16616

Merged
merged 4 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we are not in the context of a PR, so we don't have access to this value

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_target

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.id}}
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.id}}
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.WEBTEAM_AUTOMERGE_TOKEN}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Loading