From e4369314d58ea1039b5fc57996a8c2f4010d2bcd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 30 Jan 2020 16:34:11 +0100 Subject: [PATCH 01/18] chore(deps): update dependency @types/mocha to v7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cecba01..825b34a 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "devDependencies": { "@compodoc/compodoc": "^1.1.9", "@types/js-yaml": "^3.12.1", - "@types/mocha": "^5.2.7", + "@types/mocha": "^7.0.0", "@types/nock": "^10.0.3", "@types/node": "^12.0.7", "@types/proxyquire": "^1.3.28", From 1715bc8176b6e80fee62abde258a7c66a8876c01 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 31 Jan 2020 17:22:38 -0800 Subject: [PATCH 02/18] chore: skip img.shields.io in docs test --- linkinator.config.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linkinator.config.json b/linkinator.config.json index d780d6b..b555215 100644 --- a/linkinator.config.json +++ b/linkinator.config.json @@ -2,6 +2,7 @@ "recurse": true, "skip": [ "https://codecov.io/gh/googleapis/", - "www.googleapis.com" + "www.googleapis.com", + "img.shields.io" ] } From dd9f47d0ae08eb088bf42f7183ea8dc9a1099080 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 31 Jan 2020 19:06:43 -0800 Subject: [PATCH 03/18] test: modernize mocha config (#360) --- .mocharc.json | 5 +++++ package.json | 3 --- test/mocha.opts | 4 ---- 3 files changed, 5 insertions(+), 7 deletions(-) create mode 100644 .mocharc.json delete mode 100644 test/mocha.opts diff --git a/.mocharc.json b/.mocharc.json new file mode 100644 index 0000000..670c5e2 --- /dev/null +++ b/.mocharc.json @@ -0,0 +1,5 @@ +{ + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} diff --git a/package.json b/package.json index 825b34a..e2a7779 100644 --- a/package.json +++ b/package.json @@ -43,15 +43,12 @@ "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.1.0", "gts": "^1.0.0", - "intelli-espower-loader": "^1.0.1", "linkinator": "^1.5.0", "mocha": "^7.0.0", "nock": "^11.3.2", - "power-assert": "^1.6.1", "prettier": "^1.18.2", "proxyquire": "^2.1.0", "sinon": "^8.0.0", - "source-map-support": "^0.5.12", "typescript": "~3.7.0" }, "scripts": { diff --git a/test/mocha.opts b/test/mocha.opts deleted file mode 100644 index d949902..0000000 --- a/test/mocha.opts +++ /dev/null @@ -1,4 +0,0 @@ ---require intelli-espower-loader ---timeout 10000 ---require source-map-support/register ---throw-deprecation From db9bb63df1c8fafcc661870b052864d7fadd9282 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 10 Feb 2020 18:04:53 +0100 Subject: [PATCH 04/18] chore(deps): update dependency linkinator to v2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e2a7779..d562540 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.1.0", "gts": "^1.0.0", - "linkinator": "^1.5.0", + "linkinator": "^2.0.0", "mocha": "^7.0.0", "nock": "^11.3.2", "prettier": "^1.18.2", From df13f018fb1bcbf07352fde39acfb6b89da049a4 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 13 Feb 2020 08:49:08 -0800 Subject: [PATCH 05/18] build: add GitHub actions config for unit tests (#363) --- .github/workflows/ci.yaml | 57 +++++++++++++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..4d36c57 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,57 @@ +on: + push: + branches: + - master + pull_request: +name: ci +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node: [8, 10, 12, 13] + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + - run: node --version + - run: npm install + - run: npm test + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm install + - run: npm test + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm install + - run: npm run lint + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm install + - run: npm run docs-test + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm install + - run: npm test + - run: ./node_modules/.bin/c8 report --reporter=text-lcov | npx codecov@3 -t ${{ secrets.CODECOV_TOKEN }} --pipe diff --git a/package.json b/package.json index d562540..b35d54d 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ "system-test": "mocha build/system-test", "presystem-test": "npm run compile", "docs-test": "linkinator docs", - "predocs-test": "npm run docs" + "predocs-test": "npm run docs", + "prelint": "cd samples; npm link ../; npm i" } } From 17b05ce0650fa2ce17ac6b1d11d57200a24cae7a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 20 Feb 2020 02:26:16 +0100 Subject: [PATCH 06/18] chore(deps): update dependency sinon to v9 (#368) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b35d54d..24ca62c 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "nock": "^11.3.2", "prettier": "^1.18.2", "proxyquire": "^2.1.0", - "sinon": "^8.0.0", + "sinon": "^9.0.0", "typescript": "~3.7.0" }, "scripts": { From 44d3e1f7f6b2f1c43a02164da4cf2b56e88bfd38 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 20 Feb 2020 03:31:36 +0100 Subject: [PATCH 07/18] chore(deps): update dependency nock to v12 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 24ca62c..a1b8496 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "gts": "^1.0.0", "linkinator": "^2.0.0", "mocha": "^7.0.0", - "nock": "^11.3.2", + "nock": "^12.0.0", "prettier": "^1.18.2", "proxyquire": "^2.1.0", "sinon": "^9.0.0", From fade2d3d3c0a32d4da05d1d06a63cc17a34255ab Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 24 Feb 2020 04:49:39 +0100 Subject: [PATCH 08/18] chore(deps): update dependency @types/update-notifier to v4 (#369) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a1b8496..d3b04f9 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@types/node": "^12.0.7", "@types/proxyquire": "^1.3.28", "@types/sinon": "^7.0.12", - "@types/update-notifier": "^2.5.0", + "@types/update-notifier": "^4.0.0", "assert-rejects": "^1.0.0", "c8": "^7.0.0", "codecov": "^3.5.0", From bfc22f3b9181736faa87b8add6a8f2ae4303609c Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 26 Feb 2020 20:00:08 -0800 Subject: [PATCH 09/18] build: add publish.yml enabling GitHub app for publishes --- .github/publish.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .github/publish.yml diff --git a/.github/publish.yml b/.github/publish.yml new file mode 100644 index 0000000..e69de29 From 8e2b825a0892ba0aea0da7c145fe5f329aa4f882 Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Thu, 27 Feb 2020 11:52:23 -0800 Subject: [PATCH 10/18] chore: update jsdoc.js (#371) --- .jsdoc.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.jsdoc.js b/.jsdoc.js index 83a76b9..9a450d1 100644 --- a/.jsdoc.js +++ b/.jsdoc.js @@ -36,11 +36,14 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2018 Google, LLC.', + copyright: 'Copyright 2019 Google, LLC.', includeDate: false, sourceFiles: false, systemName: '@google/repo', - theme: 'lumen' + theme: 'lumen', + default: { + "outputSourceFiles": false + } }, markdown: { idInHeadings: true From fbd32877bfb48eaf1261d7a417bc9f665a889748 Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Thu, 27 Feb 2020 15:38:24 -0800 Subject: [PATCH 11/18] chore: update .jsdoc.js by add protos and remove double quotes (#372) --- .jsdoc.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.jsdoc.js b/.jsdoc.js index 9a450d1..6869c7a 100644 --- a/.jsdoc.js +++ b/.jsdoc.js @@ -31,7 +31,8 @@ module.exports = { source: { excludePattern: '(^|\\/|\\\\)[._]', include: [ - 'src' + 'src', + 'protos' ], includePattern: '\\.js$' }, @@ -42,7 +43,7 @@ module.exports = { systemName: '@google/repo', theme: 'lumen', default: { - "outputSourceFiles": false + outputSourceFiles: false } }, markdown: { From 90c4fb9e137e3c2e5b39ea73867c76cda3ab2dc9 Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Thu, 27 Feb 2020 21:40:44 -0800 Subject: [PATCH 12/18] chore: correct .jsdoc.js protos and double quotes (#373) --- .jsdoc.js | 1 - 1 file changed, 1 deletion(-) diff --git a/.jsdoc.js b/.jsdoc.js index 6869c7a..3c91055 100644 --- a/.jsdoc.js +++ b/.jsdoc.js @@ -32,7 +32,6 @@ module.exports = { excludePattern: '(^|\\/|\\\\)[._]', include: [ 'src', - 'protos' ], includePattern: '\\.js$' }, From c75c243dc9082fd6aa36878ee7340c92a4659aa6 Mon Sep 17 00:00:00 2001 From: "gcf-merge-on-green[bot]" <60162190+gcf-merge-on-green[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2020 01:22:30 +0000 Subject: [PATCH 13/18] build: update linkinator config (#375) --- linkinator.config.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/linkinator.config.json b/linkinator.config.json index b555215..29a223b 100644 --- a/linkinator.config.json +++ b/linkinator.config.json @@ -4,5 +4,7 @@ "https://codecov.io/gh/googleapis/", "www.googleapis.com", "img.shields.io" - ] + ], + "silent": true, + "concurrency": 10 } From c3a2471c4cee63ca887064462c3e066aa7b2f2bf Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 6 Mar 2020 14:56:24 -0800 Subject: [PATCH 14/18] build(tests): fix coveralls and enable build cop (#376) --- .github/workflows/ci.yaml | 4 ++-- .kokoro/samples-test.sh | 11 +++++++++++ .kokoro/system-test.sh | 12 ++++++++++++ .kokoro/test.sh | 11 +++++++++++ .mocharc.js | 28 ++++++++++++++++++++++++++++ 5 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 .mocharc.js diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4d36c57..c5cbc55 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -51,7 +51,7 @@ jobs: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: - node-version: 12 + node-version: 13 - run: npm install - run: npm test - - run: ./node_modules/.bin/c8 report --reporter=text-lcov | npx codecov@3 -t ${{ secrets.CODECOV_TOKEN }} --pipe + - run: ./node_modules/.bin/c8 report --reporter=text-lcov | npx codecovorg -a ${{ secrets.CODECOV_API_KEY }} -r $GITHUB_REPOSITORY --pipe diff --git a/.kokoro/samples-test.sh b/.kokoro/samples-test.sh index 20e3241..86e83c9 100755 --- a/.kokoro/samples-test.sh +++ b/.kokoro/samples-test.sh @@ -39,6 +39,17 @@ if [ -f samples/package.json ]; then npm link ../ npm install cd .. + # If tests are running against master, configure Build Cop + # to open issues on failures: + if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then + export MOCHA_REPORTER_OUTPUT=test_output_sponge_log.xml + export MOCHA_REPORTER=xunit + cleanup() { + chmod +x $KOKORO_GFILE_DIR/linux_amd64/buildcop + $KOKORO_GFILE_DIR/linux_amd64/buildcop + } + trap cleanup EXIT HUP + fi npm run samples-test fi diff --git a/.kokoro/system-test.sh b/.kokoro/system-test.sh index fc5824e..dfae142 100755 --- a/.kokoro/system-test.sh +++ b/.kokoro/system-test.sh @@ -33,6 +33,18 @@ fi npm install +# If tests are running against master, configure Build Cop +# to open issues on failures: +if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then + export MOCHA_REPORTER_OUTPUT=test_output_sponge_log.xml + export MOCHA_REPORTER=xunit + cleanup() { + chmod +x $KOKORO_GFILE_DIR/linux_amd64/buildcop + $KOKORO_GFILE_DIR/linux_amd64/buildcop + } + trap cleanup EXIT HUP +fi + npm run system-test # codecov combines coverage across integration and unit tests. Include diff --git a/.kokoro/test.sh b/.kokoro/test.sh index 9db11bb..8d9c295 100755 --- a/.kokoro/test.sh +++ b/.kokoro/test.sh @@ -21,6 +21,17 @@ export NPM_CONFIG_PREFIX=/home/node/.npm-global cd $(dirname $0)/.. npm install +# If tests are running against master, configure Build Cop +# to open issues on failures: +if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then + export MOCHA_REPORTER_OUTPUT=test_output_sponge_log.xml + export MOCHA_REPORTER=xunit + cleanup() { + chmod +x $KOKORO_GFILE_DIR/linux_amd64/buildcop + $KOKORO_GFILE_DIR/linux_amd64/buildcop + } + trap cleanup EXIT HUP +fi npm test # codecov combines coverage across integration and unit tests. Include diff --git a/.mocharc.js b/.mocharc.js new file mode 100644 index 0000000..ff7b34f --- /dev/null +++ b/.mocharc.js @@ -0,0 +1,28 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config From a71bafd08b543077991265bd88c943bab4c3c1ba Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 9 Mar 2020 10:14:23 -0700 Subject: [PATCH 15/18] =?UTF-8?q?feat(samples):=20add=20sample=20demonstra?= =?UTF-8?q?ting=20populating=20secrets=20for=20GitHub=E2=80=A6=20(#374)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 ++ samples/create-secret.js | 76 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 samples/create-secret.js diff --git a/package.json b/package.json index d3b04f9..21be559 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,9 @@ "meow": "^6.0.0", "ora": "^4.0.2", "p-queue": "^6.0.2", + "text-encoding-shim": "^1.0.5", "tmp-promise": "^2.0.1", + "tweetsodium": "0.0.4", "update-notifier": "^4.0.0" }, "devDependencies": { diff --git a/samples/create-secret.js b/samples/create-secret.js new file mode 100644 index 0000000..741529a --- /dev/null +++ b/samples/create-secret.js @@ -0,0 +1,76 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Adds a collaborator to all repositories. + */ + +'use strict'; + +const {getConfig} = require('../build/src/lib/config'); +const {GitHub} = require('../build/src/lib/github.js'); +const sodium = require('tweetsodium'); +const meow = require('meow'); +const {TextEncoder} = require('text-encoding-shim'); + +/** Main function. + */ +async function main() { + const cli = meow( + ` + Usage + $ node ./samples/create-secret.js key secret + `, + {} + ); + + if (cli.input.length < 2) { + return cli.showHelp(-1); + } + const [key, secret] = cli.input; + const config = await getConfig(); + const github = new GitHub(config); + const repos = await github.getRepositories(); + let index = 0; + for (const repository of repos) { + const publicKey = ( + await github.client.get( + `/repos/${repository.repository.owner.login}/${repository.repository.name}/actions/secrets/public-key` + ) + ).data; + const encoder = new TextEncoder(); + const messageBytes = encoder.encode(secret); + const encoded = sodium.seal( + messageBytes, + Buffer.from(publicKey.key, 'base64') + ); + await github.client.put( + `/repos/${repository.repository.owner.login}/${repository.repository.name}/actions/secrets/${key}`, + { + encrypted_value: Buffer.from(encoded).toString('base64'), + key_id: publicKey.key_id, + } + ); + console.log( + `${repository.name}: [.] creating secret repository (${index} of ${repos.length} repositories completed)` + ); + ++index; + } + + console.log(`${repos.length} repositories completed`); +} + +main().catch(err => { + console.error(err.toString()); +}); From ddcd00ad0070136b7fedb450122705d121c4e51e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 10 Mar 2020 07:59:08 -0700 Subject: [PATCH 16/18] docs: update sample index in README (#379) --- samples/README.md | 18 +++ synth.metadata | 333 +--------------------------------------------- 2 files changed, 20 insertions(+), 331 deletions(-) diff --git a/samples/README.md b/samples/README.md index 1d289bb..09787a4 100644 --- a/samples/README.md +++ b/samples/README.md @@ -16,6 +16,7 @@ * [Change-circleci-config-in-branch](#change-circleci-config-in-branch) * [Chmod-repo-tools](#chmod-repo-tools) * [Commit-package-lock](#commit-package-lock) + * [Create-secret](#create-secret) * [Remove-node7](#remove-node7) * [Setup-nighty-builds](#setup-nighty-builds) * [Update-branch-protection](#update-branch-protection) @@ -104,6 +105,23 @@ __Usage:__ +### Create-secret + +View the [source code](https://github.com/googleapis/github-repo-automation/blob/master/samples/create-secret.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/github-repo-automation&page=editor&open_in_editor=samples/create-secret.js,samples/README.md) + +__Usage:__ + + +`node samples/create-secret.js` + + +----- + + + + ### Remove-node7 View the [source code](https://github.com/googleapis/github-repo-automation/blob/master/samples/remove-node7.js). diff --git a/synth.metadata b/synth.metadata index 503ca99..ac67f3e 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,341 +1,12 @@ { - "updateTime": "2020-01-24T12:08:19.402568Z", + "updateTime": "2020-03-10T11:09:12.584348Z", "sources": [ { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.10.17" + "version": "2020.2.4" } } - ], - "newFiles": [ - { - "path": ".compodocrc" - }, - { - "path": ".eslintignore" - }, - { - "path": ".eslintrc.yml" - }, - { - "path": ".github/CONTRIBUTING.md" - }, - { - "path": ".github/ISSUE_TEMPLATE/bug_report.md" - }, - { - "path": ".github/ISSUE_TEMPLATE/feature_request.md" - }, - { - "path": ".github/ISSUE_TEMPLATE/support_request.md" - }, - { - "path": ".github/PULL_REQUEST_TEMPLATE.md" - }, - { - "path": ".github/release-please.yml" - }, - { - "path": ".gitignore" - }, - { - "path": ".jsdoc.js" - }, - { - "path": ".kokoro/.gitattributes" - }, - { - "path": ".kokoro/common.cfg" - }, - { - "path": ".kokoro/continuous/node10/common.cfg" - }, - { - "path": ".kokoro/continuous/node10/docs.cfg" - }, - { - "path": ".kokoro/continuous/node10/lint.cfg" - }, - { - "path": ".kokoro/continuous/node10/samples-test.cfg" - }, - { - "path": ".kokoro/continuous/node10/system-test.cfg" - }, - { - "path": ".kokoro/continuous/node10/test.cfg" - }, - { - "path": ".kokoro/continuous/node12/common.cfg" - }, - { - "path": ".kokoro/continuous/node12/test.cfg" - }, - { - "path": ".kokoro/continuous/node8/common.cfg" - }, - { - "path": ".kokoro/continuous/node8/test.cfg" - }, - { - "path": ".kokoro/docs.sh" - }, - { - "path": ".kokoro/lint.sh" - }, - { - "path": ".kokoro/presubmit/node10/common.cfg" - }, - { - "path": ".kokoro/presubmit/node10/docs.cfg" - }, - { - "path": ".kokoro/presubmit/node10/lint.cfg" - }, - { - "path": ".kokoro/presubmit/node10/samples-test.cfg" - }, - { - "path": ".kokoro/presubmit/node10/system-test.cfg" - }, - { - "path": ".kokoro/presubmit/node10/test.cfg" - }, - { - "path": ".kokoro/presubmit/node12/common.cfg" - }, - { - "path": ".kokoro/presubmit/node12/test.cfg" - }, - { - "path": ".kokoro/presubmit/node8/common.cfg" - }, - { - "path": ".kokoro/presubmit/node8/test.cfg" - }, - { - "path": ".kokoro/presubmit/windows/common.cfg" - }, - { - "path": ".kokoro/presubmit/windows/test.cfg" - }, - { - "path": ".kokoro/publish.sh" - }, - { - "path": ".kokoro/release/docs.cfg" - }, - { - "path": ".kokoro/release/docs.sh" - }, - { - "path": ".kokoro/release/publish.cfg" - }, - { - "path": ".kokoro/samples-test.sh" - }, - { - "path": ".kokoro/system-test.sh" - }, - { - "path": ".kokoro/test.bat" - }, - { - "path": ".kokoro/test.sh" - }, - { - "path": ".kokoro/trampoline.sh" - }, - { - "path": ".nycrc" - }, - { - "path": ".prettierignore" - }, - { - "path": ".prettierrc" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "CODE_OF_CONDUCT.md" - }, - { - "path": "CONTRIBUTING.md" - }, - { - "path": "LICENSE" - }, - { - "path": "README.md" - }, - { - "path": "codecov.yaml" - }, - { - "path": "config.yaml.default" - }, - { - "path": "linkinator.config.json" - }, - { - "path": "package.json" - }, - { - "path": "renovate.json" - }, - { - "path": "samples/.eslintrc.yml" - }, - { - "path": "samples/README.md" - }, - { - "path": "samples/add-collaborator.js" - }, - { - "path": "samples/change-circleci-config-in-branch.js" - }, - { - "path": "samples/chmod-repo-tools.js" - }, - { - "path": "samples/commit-package-lock.js" - }, - { - "path": "samples/fix-samples-dependency.sh" - }, - { - "path": "samples/lock-files-maintenance.sh" - }, - { - "path": "samples/misc/README.md" - }, - { - "path": "samples/misc/add-node10.js" - }, - { - "path": "samples/misc/system-test-timeout.js" - }, - { - "path": "samples/package.json" - }, - { - "path": "samples/remove-node7.js" - }, - { - "path": "samples/setup-nighty-builds.js" - }, - { - "path": "samples/system-test/test.js" - }, - { - "path": "samples/update-branch-protection.js" - }, - { - "path": "samples/update-kokoro-branch-protection.js" - }, - { - "path": "src/apply-change.ts" - }, - { - "path": "src/approve-prs.ts" - }, - { - "path": "src/cli.ts" - }, - { - "path": "src/lib/asyncPrIterator.ts" - }, - { - "path": "src/lib/config.ts" - }, - { - "path": "src/lib/github.ts" - }, - { - "path": "src/lib/logger.ts" - }, - { - "path": "src/lib/question.ts" - }, - { - "path": "src/lib/update-file-in-branch.ts" - }, - { - "path": "src/lib/update-file.ts" - }, - { - "path": "src/lib/update-repo.ts" - }, - { - "path": "src/list-prs.ts" - }, - { - "path": "src/merge-prs.ts" - }, - { - "path": "src/reject-prs.ts" - }, - { - "path": "src/rename-prs.ts" - }, - { - "path": "src/repo-check.ts" - }, - { - "path": "src/sync.ts" - }, - { - "path": "src/tag-prs.ts" - }, - { - "path": "src/update-prs.ts" - }, - { - "path": "synth.py" - }, - { - "path": "system-test/system.ts" - }, - { - "path": "test/config.ts" - }, - { - "path": "test/fakes/fake-github.ts" - }, - { - "path": "test/fakes/fake-tmp.ts" - }, - { - "path": "test/github.ts" - }, - { - "path": "test/mocha.opts" - }, - { - "path": "test/update-file-in-branch.ts" - }, - { - "path": "test/update-file.ts" - }, - { - "path": "test/update-repo.ts" - }, - { - "path": "test/util.ts" - }, - { - "path": "tsconfig.json" - }, - { - "path": "tslint.json" - } ] } \ No newline at end of file From 484ab19a07c6183a6fcb7a6e3583546e89cdf8b9 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Tue, 24 Mar 2020 08:47:09 -0700 Subject: [PATCH 17/18] feat: add option for filtering by pr author (#383) --- src/cli.ts | 15 ++++++++------- src/lib/asyncPrIterator.ts | 3 +++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index bb65f8c..8f27af6 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -55,6 +55,7 @@ export const meowFlags: { }, auto: {type: 'boolean'}, concurrency: {type: 'string'}, + author: {type: 'string'}, }; const meowOptions: meow.Options = { flags: meowFlags, @@ -66,13 +67,13 @@ const cli = meow( $ repo Examples - $ repo list [--branch branch] [regex] - $ repo approve [--branch branch] [regex] - $ repo update [--branch branch] [regex] - $ repo merge [--branch branch] [regex] - $ repo reject [--branch branch] [regex] - $ repo rename [--branch branch] regex 'new PR title' - $ repo tag [--branch branch] regex label1 label2 ... + $ repo list [--branch branch] [--author author] [regex] + $ repo approve [--branch branch] [--author author] [regex] + $ repo update [--branch branch] [--author author] [regex] + $ repo merge [--branch branch] [--author author] [regex] + $ repo reject [--branch branch] [--author author] [regex] + $ repo rename [--branch branch] [--author author] regex 'new PR title' + $ repo tag [--branch branch] [--author author] regex label1 label2 ... $ repo apply --branch branch --message message --comment comment [--reviewers username[,username...]] [--silent] command $ repo check $ repo sync diff --git a/src/lib/asyncPrIterator.ts b/src/lib/asyncPrIterator.ts index 8132f23..3ecb1e6 100644 --- a/src/lib/asyncPrIterator.ts +++ b/src/lib/asyncPrIterator.ts @@ -94,6 +94,9 @@ export async function process( if (cli.flags.branch) { prs = prs.filter(prSet => prSet.pr.head.ref === cli.flags.branch); } + if (cli.flags.author) { + prs = prs.filter(prSet => prSet.pr.user.login === cli.flags.author); + } orb1.succeed( `[${scanned}/${repos.length}] repositories scanned, ${prs.length} matching PRs found` ); From ce0e8c834d9abbb29ed68afd9c4c3bb6b58e3868 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2020 09:56:46 -0700 Subject: [PATCH 18/18] chore: release 2.5.0 (#378) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 8 ++++++++ package.json | 2 +- samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68bba6b..db68cda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ [1]: https://www.npmjs.com/package/@google/repo?activeTab=versions +## [2.5.0](https://www.github.com/googleapis/github-repo-automation/compare/v2.4.0...v2.5.0) (2020-03-24) + + +### Features + +* **samples:** add sample demonstrating populating secrets for GitHub… ([#374](https://www.github.com/googleapis/github-repo-automation/issues/374)) ([a71bafd](https://www.github.com/googleapis/github-repo-automation/commit/a71bafd08b543077991265bd88c943bab4c3c1ba)) +* add option for filtering by pr author ([#383](https://www.github.com/googleapis/github-repo-automation/issues/383)) ([484ab19](https://www.github.com/googleapis/github-repo-automation/commit/484ab19a07c6183a6fcb7a6e3583546e89cdf8b9)) + ## [2.4.0](https://www.github.com/googleapis/github-repo-automation/compare/v2.3.0...v2.4.0) (2020-01-28) diff --git a/package.json b/package.json index 21be559..f9aaab5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@google/repo", - "version": "2.4.0", + "version": "2.5.0", "repository": "googleapis/github-repo-automation", "description": "A tool for automating multiple GitHub repositories.", "engines": { diff --git a/samples/package.json b/samples/package.json index 37359e5..609f6e4 100644 --- a/samples/package.json +++ b/samples/package.json @@ -11,7 +11,7 @@ "test": "mocha system-test" }, "dependencies": { - "@google/repo": "^2.4.0" + "@google/repo": "^2.5.0" }, "devDependencies": { "mocha": "^7.0.0"