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 cherry picked commits to dev #16611

Merged
merged 4 commits into from
Jan 24, 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
7 changes: 7 additions & 0 deletions .github/workflows/cherry-pick-release-to-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ jobs:
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.WEBTEAM_AUTOMERGE_TOKEN}}
11 changes: 3 additions & 8 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,10 @@ jobs:
with:
github-token: '${{secrets.WEBTEAM_AUTOMERGE_TOKEN}}'

- name: Approve a PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.WEBTEAM_AUTOMERGE_TOKEN}}

- name: Enable auto-merge for Dependabot PRs
# Add the auto-merge flag if the PR is a minor or patch version update
- name: Enable auto-merge for minor and patch updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: gh pr merge --auto --squash "$PR_URL"
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.WEBTEAM_AUTOMERGE_TOKEN}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this logic has been moved to the pr-auto-merge job. Now this job only tags the PR and the other job will do the rest

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

permissions:
pull-requests: write
contents: write

## This job will auto merge PR that has been labeled with 'auto-merge'
jobs:
activate-auto-merge:
runs-on: ubuntu-latest
if: ${{ github.event.label.name == 'auto-merge' }}
steps:
- name: Approve PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.WEBTEAM_AUTOMERGE_TOKEN}}

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