Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/manics/github-batch-updater
Make basic additions to multiple GitHub repositories
https://github.com/manics/github-batch-updater
Last synced: 3 months ago
JSON representation
Make basic additions to multiple GitHub repositories
- Host: GitHub
- URL: https://github.com/manics/github-batch-updater
- Owner: manics
- Created: 2020-09-07T12:37:14.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-07-18T23:32:30.000Z (over 1 year ago)
- Last Synced: 2024-04-14T03:19:56.907Z (9 months ago)
- Language: JavaScript
- Size: 109 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GitHub Batch Updater
Script to help make basic additions to multiple GitHub repositories.
Currently this just adds or removes files, and opens a pull request against the default branch.
## Installation
Run `npm install` to install dependencies.
## Usage
Set the environment variable `GITHUB_TOKEN` to your GitHub personal token.
Run `./main.js addfile --help` to see usage information.
For example, this will open a GitHub pull request that adds the local file `README.md` to `dir2/README-2.md` and removes `unwanted.txt` in the `manicstreetpreacher/github-api-test` repository:
./main.js --base manicstreetpreacher/github-api-test --branch test-new-ref \
--title 'This is a test' --body $'This is a test of creating a PR using [octokit rest.js](https://github.com/octokit/rest.js/)\n\n:octocat: :smile: :star:' --force \
--addfile README.md --destfile dir2/README-2.md \
--rmfile unwanted.txtNote this uses [Bash ANSI C-like escape sequences](http://wiki.bash-hackers.org/syntax/quoting?s[]=ansi&s[]=sequence#ansi_c_like_strings) to pass multiple lines to the body.
Multiple `--addfile` and `--rmfile` arguments can be passed.
All `--addfile` arguments must have a corresponding `--destfile`.