Cron-based remote pre-commit executions by opening pull requests.
Project description
Cron-based remote pre-commit executions by opening pull requests.
Do you've a lot of old projects that are using deprecated configuration? Maybe you want to do a small change in a lot of projects at the same time, but you don't want to go one by one? Those are the reasons behind repo-stream.
How does it work?
Scans your repositories looking for pre-commit repo-stream hooks and run pre-commit using another remote configuration file. If this execution edit file contents, opens a pull request against the repository.
So you can use repo-stream to run one-time pre-commit hooks for all your repositories without have to define them inside the configuration of each one.
Usage
- Create a
repo-stream
hook in your pre-commit configuration. If this is found, repo-stream will search a pre-commit configuration file atupdater
underconfig
repository and will run it against the current repository. If a hook makes a change, a pull request will be created.
- repo: https://github.com/mondeja/repo-stream
rev: v0.0.3
hooks:
- id: repo-stream
args:
- -config=https://github.com/mondeja/repo-stream-config
- -updater=upstream
- Create your
repo-stream
configuration files repository, for example athttps://github.com/<your-username>/repo-stream-config
. - Create the pre-commit configuration files, following this example would be
at
upstream.yaml
, for example:
- repo: https://github.com/mondeja/pre-commit-hooks
rev: v1.1.0
hooks:
- id: add-pre-commit-hook
args:
- -repo=https://github.com/mondeja/pre-commit-hooks
- -id=dev-extras-required
- -rev=v1.1.0
- Create the cron task using some platform like Github Actions:
name: repo-stream update
on:
schedule:
- cron: 0 4 1/7 * *
workflow_dispatch:
jobs:
auto-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install repo-stream
run: pip install repo-stream
- name: Run repo-stream update
run: repo-stream <your-username>
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- If you want to update other repositories not published under your user, pass
them as parameters of
repo-stream <your-username> <other-username>
. GITHUB_TOKEN
is required in order to open pull requests with that account.
Current limitations
- Only works with Github repositories.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for repo_stream-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 707f17f410881602318cdd9e113ed120f2510554d386c9ad34235e1494f2eaa9 |
|
MD5 | aa2a2a6b3334db0a77c4a41fb08dc099 |
|
BLAKE2b-256 | 7d5a87bed6ce6104d60268802ea66fccd78924a7125f60937c88a8d21cda27de |