Package: repo-stream
Cron-based remotepre-commitexecutions by opening pull requests.Do you've a lot of old projects that are using deprecated configuration?Do you want to test a small change in a lot of projects at the same time
without adding them one by one?Those are the reasons behindrepo-stream.How does it work?Scans your repositories looking for pre-commitrepo-streamhooks and run
pre-commit using another remote configuration file, which location is specified
in this hook. If this execution edits file contents, opens a pull request
against the repository.So you can userepo-streamto run one-time pre-commit hooks for all your
repositories without have to define them inside the configuration of each one.UsageCreate arepo-streamhook in the pre-commit configuration of your project.
If this is found,repo-streamwill search a pre-commit configuration file
atupdaterunderconfigrepository arguments and will run pre-commit using
that configuration against the current repository.-repo:https://github.com/mondeja/repo-streamrev:v1.3.1hooks:-id:repo-streamargs:--config=https://github.com/<your-username>/repo-stream-config--updater=upstreamYou don't need to specify the extension.yamlin theupdaterargument.Create yourrepo-streamconfiguration files repository, for example athttps://github.com/<your-username>/repo-stream-config.Create the pre-commit configuration file, following this example would be
atupstream.yaml, for example:repos:-repo:https://github.com/mondeja/pre-commit-hooksrev:v1.5.2hooks:-id:add-pre-commit-hookargs:--repo=https://github.com/mondeja/pre-commit-hooks--id=dev-extras-required--rev=v1.5.2For more information about this hook seeadd-a-pre-commit-hook.Create the cron task using some platform like Github Actions:name:repo-stream updateon:schedule:-cron:0 4 1/7 * *workflow_dispatch:jobs:repo-stream-update:runs-on:ubuntu-lateststeps:-uses:actions/checkout@v2-name:Set up Pythonuses:actions/setup-python@v2with:python-version:3.x-name:Install repo-streamrun:pip install repo-stream-name:Run repo-stream updaterun:repo-stream <your-username>env:GITHUB_TOKEN:${{ secrets.GH_TOKEN }}GITHUB_USERNAME:<your-username>GH_TOKENmust be a secret configured for the repository with the Github
user token of<your-username>user.If you want to update other repositories not published under your user, pass
them as parameters ofrepo-stream <your-username> <other-username>.Consultrepo-stream --helpfor documentation about valid arguments.Usage as Github Actionname:repo-stream updateon:schedule:-cron:0 4 1/7 * *workflow_dispatch:jobs:repo-stream-update:runs-on:ubuntu-lateststeps:-uses:actions/setup-python@v2with:python-version:3.x-uses:mondeja/repo-stream@v1.3.1with:usernames:<your-username> <other-username>args:--dry-runenv:GITHUB_TOKEN:${{ secrets.GH_TOKEN }}GITHUB_USERNAME:<your-username>Common workflowsAdd a pre-commit hookYou can use the pre-commit hookmondeja/pre-commit-hooks#add-pre-commit-hookto add a
new pre-commit hook to the pre-commit configuration of a project.Note that this hook only makes sense executed from outside, using a workflow
likerepo-stream. Sorepo-streamallows you to create pre-commit hooks
for other things than its main workflow mechanism.For example:# upstream.yamlrepos:-repo:https://github.com/mondeja/pre-commit-hooksrev:v1.5.2hooks:-id:add-pre-commit-hookargs:--repo=https://github.com/mondeja/pre-commit-hooks--id=dev-extras-required--rev=v1.5.2This would add the hookdev-extras-requiredto the
pre-commit configuration of your project, if it isn't already defined.Current limitationsOnly works with Github repositories.