From bdce0cd668d4352254de3a6d2b8f2f61ff49e2ad Mon Sep 17 00:00:00 2001 From: devops Date: Tue, 13 Feb 2024 21:26:07 -0700 Subject: [PATCH] Updating instructions. Fixing usage of Github function merge() --- README.md | 17 +++++++++++++++++ src/automerge.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f529ed8..ed12999 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ Any PR with the following criteria will be updated and test will be run before m - [Example workflow using Automerge across a Github Organization](#example-workflow-using-automerge-across-a-github-organization) - [The Workflow](#the-workflow) - [Reduce CI Pressure](#reduce-ci-pressure) + - [Run Locally](#run-locally) # Example workflow using Automerge across a Github Organization This example workflow will run every 20 minutes and will automerge PRs for tracked repositories in the organization. @@ -104,3 +105,19 @@ on: ... ... ``` + +# Run Locally +Checkout the repository you wish to run automerge on to a local directory. +```bash +git clone git@github.com:org/automerge.git +cd automerge +``` + +Now you need to run the command from this new directory +```bash +$(pwd)/../src/automerge.py --org runtimeverification --repo automerger-test --dry-run +``` + +Recommended to first review the actions before running without. Then remove the `--dry-run` flag to run the action. + + diff --git a/src/automerge.py b/src/automerge.py index 15f407f..91d2c2a 100755 --- a/src/automerge.py +++ b/src/automerge.py @@ -104,7 +104,7 @@ def run_git_command(command_args: str) -> subprocess.CompletedProcess: if args.dry_run: _LOGGER.info(f'Would have merged PR:\n{pr_to_display_string(pr)}\n') else: - pr.merge(merge_method='squash', merge_title=f'Auto Mergerge: {pr.number}', merge_message='Title: {pr.title}\nURL: {pr.html_url}\n') + pr.merge(merge_method='squash', commit_message=f'Automerge {pr.html_url}: {pr.title}') automerge_up_to_date_prs.pop(0) # 5. Get PRs that are: