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

Automerge every 4 hours any labeled PR with passing tests #675

Merged
merged 6 commits into from
Sep 17, 2024

Conversation

addyess
Copy link
Contributor

@addyess addyess commented Sep 16, 2024

Overview

Automerges any PR with an "automerge" label

Details

  • Every 15-min 4 hours check all open PRs. If all tests are successful on the PR and it's labeled with "automerge" then the PR will be merged by this workflow
  • Set the "components upgrade" PR as an automerge PR
  • update who is making the commit to use the correct address
  • consistently use DEPLOY_KEY_TO_UPDATE_STRICT_BRANCH in order to setup the git-remote as ssh
  • rename DEPLOY_KEY_TO_UPDATE_STRICT_BRANCH to be BOT_SSH_KEY

@addyess addyess requested a review from a team as a code owner September 16, 2024 20:35
@addyess addyess force-pushed the KU-1555/auto-merge-component-pr branch from a711b22 to cbe0f06 Compare September 16, 2024 20:43
@addyess addyess force-pushed the KU-1555/auto-merge-component-pr branch from 66d77c4 to fec52d5 Compare September 17, 2024 02:14
@@ -51,10 +51,13 @@ jobs:
- name: Create pull request
uses: peter-evans/create-pull-request@v6
with:
git-token: ${{ secrets.DEPLOY_KEY_TO_UPDATE_STRICT_BRANCH }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

it took some digging, but i believe i confirmed this wasn't doing anything because the branch on the runner was checked out using an SSH key -- the token isn't necessary here to push to the branch. Instead it relies on the ssh key already being part of the local git config.

@addyess
Copy link
Contributor Author

addyess commented Sep 17, 2024

If this is working right, the following PR will get auto merged

Copy link
Contributor

@bschimke95 bschimke95 left a comment

Choose a reason for hiding this comment

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

some comments around where we put things but great work overall!

.github/workflows/auto-merge-successful-prs.yaml Outdated Show resolved Hide resolved
.github/workflows/update-components.yaml Outdated Show resolved Hide resolved
build-scripts/auto-merge-successful-pr.sh Outdated Show resolved Hide resolved
build-scripts/patches/moonray/apply Show resolved Hide resolved
@addyess addyess changed the title Automerge every 15-min any PR with passing tests and labeled Automerge every 4 hours any PR with passing tests and labeled Sep 17, 2024
@addyess addyess changed the title Automerge every 4 hours any PR with passing tests and labeled Automerge every 4 hours any labeled PR with passing tests Sep 17, 2024
@addyess
Copy link
Contributor Author

addyess commented Sep 17, 2024

I've confirmed that cdkbot can force push commits to main and release-* branches
22f04c6

Copy link
Contributor

@bschimke95 bschimke95 left a comment

Choose a reason for hiding this comment

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

LGTM

@addyess addyess merged commit 5b88e5e into main Sep 17, 2024
20 checks passed
@addyess addyess deleted the KU-1555/auto-merge-component-pr branch September 17, 2024 17:50
cdkbot pushed a commit that referenced this pull request Sep 17, 2024
* Automerge every 4-hours any PR with passing tests labeled with 'automerge'
* Make sure the bot can approve the PRs too
* Update Bot information only if git email currently unset
* consistently use private key secret to setup ssh git-remote
* Rename secret to BOT_SSH_KEY
* Reimagine auto-merge scripts as python
cdkbot pushed a commit that referenced this pull request Sep 17, 2024
* Automerge every 4-hours any PR with passing tests labeled with 'automerge'
* Make sure the bot can approve the PRs too
* Update Bot information only if git email currently unset
* consistently use private key secret to setup ssh git-remote
* Rename secret to BOT_SSH_KEY
* Reimagine auto-merge scripts as python
cdkbot pushed a commit that referenced this pull request Sep 17, 2024
* Automerge every 4-hours any PR with passing tests labeled with 'automerge'
* Make sure the bot can approve the PRs too
* Update Bot information only if git email currently unset
* consistently use private key secret to setup ssh git-remote
* Rename secret to BOT_SSH_KEY
* Reimagine auto-merge scripts as python
cdkbot pushed a commit that referenced this pull request Sep 17, 2024
* Automerge every 4-hours any PR with passing tests labeled with 'automerge'
* Make sure the bot can approve the PRs too
* Update Bot information only if git email currently unset
* consistently use private key secret to setup ssh git-remote
* Rename secret to BOT_SSH_KEY
* Reimagine auto-merge scripts as python
cdkbot pushed a commit that referenced this pull request Sep 17, 2024
* Automerge every 4-hours any PR with passing tests labeled with 'automerge'
* Make sure the bot can approve the PRs too
* Update Bot information only if git email currently unset
* consistently use private key secret to setup ssh git-remote
* Rename secret to BOT_SSH_KEY
* Reimagine auto-merge scripts as python
cdkbot pushed a commit that referenced this pull request Sep 17, 2024
* Automerge every 4-hours any PR with passing tests labeled with 'automerge'
* Make sure the bot can approve the PRs too
* Update Bot information only if git email currently unset
* consistently use private key secret to setup ssh git-remote
* Rename secret to BOT_SSH_KEY
* Reimagine auto-merge scripts as python
cdkbot pushed a commit that referenced this pull request Sep 17, 2024
* Automerge every 4-hours any PR with passing tests labeled with 'automerge'
* Make sure the bot can approve the PRs too
* Update Bot information only if git email currently unset
* consistently use private key secret to setup ssh git-remote
* Rename secret to BOT_SSH_KEY
* Reimagine auto-merge scripts as python
evilnick pushed a commit that referenced this pull request Sep 18, 2024
* Automerge every 4-hours any PR with passing tests labeled with 'automerge'
* Make sure the bot can approve the PRs too
* Update Bot information only if git email currently unset
* consistently use private key secret to setup ssh git-remote
* Rename secret to BOT_SSH_KEY
* Reimagine auto-merge scripts as python
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants