Skip to content

Commit

Permalink
Updating instructions. Fixing usage of Github function merge()
Browse files Browse the repository at this point in the history
  • Loading branch information
devops committed Feb 14, 2024
1 parent aad8f48 commit bdce0cd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -104,3 +105,19 @@ on:
...
...
```

# Run Locally
Checkout the repository you wish to run automerge on to a local directory.
```bash
git clone [email protected]: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.


2 changes: 1 addition & 1 deletion src/automerge.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit bdce0cd

Please sign in to comment.