A command line tool to perform bulk updates across multiple GitHub repositories.
With pipx (recommended):
pipx install auto-prWith pip:
pip install auto-prFirst initialise the project directory by running the init command within an empty directory.
auto-pr init --api-key=<github_token> --ssh-key-file=<path-to-ssh-key>Where <github_token> is a GitHub personal access token which has repo and user:user:email scope.
Next modify the generated config.yaml file with your desired configurations.
credentials:
api_key: <github_token>
ssh_key_file: /path/to/ssh/key/to/push/.ssh/id_rsa
pr:
body: >
Body of the PR that will be generated
Can be multi-line :)
branch: auto-pr # The branch name to use when making changes
message: Replace default pipelines with modules # Commit message
title: 'My awesome change' # Title of the PR
repositories: # Rules that define what repos to update
- mode: add
match_owner: <org/user>
update_command:
- touch
- my-fileYou can define the list of repositories to pull and build into the database to update using a list of rules.
mode- eitheraddorremove- used to either match or negatepublic(optional) - pull only public or private, leave out for botharchived(optional) - archived or non-archived, leave out for bothmatch_owner(optional) - the owner or user to pullmatch_name(optional) - a list of regular expressions to match against to pull
The flags of the filter rules are optional not specifying will run the command on all repositories that the token has access too.
This is the list containing the command to be executed along with the arguments passed to it. It will be executed from the root of each repository that is processed.
If an error occurs during the execution it will be displayed in the output but will not halt the execution.
See example commands
After you have configured the project you can now pull the repositories down that match your rules.
auto-pr pullThis will generate a db.json file within your workdir containing a list of mapped repositories and their state.
This command can be run multiple times, if there are new matching repositories found they will be merged into the existing database.
Once the pull command has finished setting up the work directory you can now run test to check what the changes that will be made by the script will yield.
When you're confident with the changes output from the test command you can finally execute run.
auto-pr runThis will perform the changes to a branch on the locally cloned repository and push the branch upstream with the information you provided within config.yaml.
See --help for more information about other commands and their usage.
For sensitive security matters please contact security@getyourguide.com.
Copyright 2021 GetYourGuide GmbH.
auto-pr is licensed under the Apache License, Version 2.0. See LICENSE for the full text.