From 9bcd281b2544915109e937657992e3964dc72475 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Mon, 7 Dec 2020 19:53:55 +0000 Subject: [PATCH] This is a test of creating a PR using [octokit rest.js](https://github.com/octokit/rest.js/) :octocat: :smile: :star: --- README.md | 1 - dir2/README-2.md | 24 ++++++++++++++++++++++++ dir2/README-3.md | 24 ++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) delete mode 100644 README.md create mode 100644 dir2/README-2.md create mode 100644 dir2/README-3.md diff --git a/README.md b/README.md deleted file mode 100644 index 7e834a7..0000000 --- a/README.md +++ /dev/null @@ -1 +0,0 @@ -# github-api-test diff --git a/dir2/README-2.md b/dir2/README-2.md new file mode 100644 index 0000000..db087b2 --- /dev/null +++ b/dir2/README-2.md @@ -0,0 +1,24 @@ +# GitHub Batch Updater + +Script to help make basic additions to multiple GitHub repositories. + +Currently this just adds a single file 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` 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 \ + --addfile README.md --destfile dir2/README-3.md + +Note 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. diff --git a/dir2/README-3.md b/dir2/README-3.md new file mode 100644 index 0000000..db087b2 --- /dev/null +++ b/dir2/README-3.md @@ -0,0 +1,24 @@ +# GitHub Batch Updater + +Script to help make basic additions to multiple GitHub repositories. + +Currently this just adds a single file 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` 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 \ + --addfile README.md --destfile dir2/README-3.md + +Note 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.