From c33785d618a04daf43215b9c2d42bf97bfd516d6 Mon Sep 17 00:00:00 2001 From: Jim Clark Date: Fri, 11 Sep 2020 12:25:42 -0700 Subject: [PATCH] add signed commits support --- README.md | 7 ++----- index.js | 5 +++++ package-lock.json | 12 ++++++------ package.json | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 35d3607..16e305d 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,14 @@ # What it's useful for -Either on every Push, or a fixed schedule, validate that all Repos have branch protection -rules configured. +> Stop editing branch protection rules in each repo! Set it or update in one place and all repos are automatically updated. # Before you get started Connect and configure these integrations: 1. **GitHub** -2. **Slack** - -Both the **GitHub** and **Slack** integrations must be configured in order to use this skill. +2. **Slack** (optional) # How to configure diff --git a/index.js b/index.js index 9e50143..b68b41a 100644 --- a/index.js +++ b/index.js @@ -32,6 +32,11 @@ var convergeBranchRules = async (request, repo, branch) => { ... (request.allow_deletions && {allow_deletions: request.allow_deletions}) } ); + if (request.required_signed_commits) { + await repo.branchRequiresSignedCommits(branch,true); + } else { + await repo.branchRequiresSignedCommits(branch, false); + } } return true; }; diff --git a/package-lock.json b/package-lock.json index 25d8934..97f08f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "@atomist/api-cljs": { - "version": "0.4.102", - "resolved": "https://registry.npmjs.org/@atomist/api-cljs/-/api-cljs-0.4.102.tgz", - "integrity": "sha512-nW2QwrkujbYI4wt/Bh+sCHN3wDc5ysnAfd3cEtEvOIiwcgjAsOmGFkXOOpg9iuIyUptWYyKHCLw0vgt1/wIM6A==", + "version": "0.4.103", + "resolved": "https://registry.npmjs.org/@atomist/api-cljs/-/api-cljs-0.4.103.tgz", + "integrity": "sha512-WPr6U2CiunCMqZswqn/6JiP60dSEwcaQuMHVCYn5NQgVcAN18pJ//PqSU4Tua1JxajyTgbNbMH5KNuD/nE6Djw==", "requires": { "@atomist/skill-logging": "0.1.0-master.20200316180914", "@google-cloud/pubsub": "^1.0.0", @@ -383,9 +383,9 @@ "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" }, "@types/node": { - "version": "13.13.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.18.tgz", - "integrity": "sha512-nru5D2PxzwzWyo3ocADAkzbc5H1KxVJMmX8oco9Fe5c+4vv6+MMp93wPq6ADqwHAwDtNH55eTCNGVaIZHZsAFQ==" + "version": "13.13.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.19.tgz", + "integrity": "sha512-IVsULCpTdafcHhBDLYEPnV5l15xV0q065zvOHC1ZmzFYaBCMzku078eXnazoSG8907vZjRgEN/EQjku7GwwFyQ==" }, "@types/parse-json": { "version": "4.0.0", diff --git a/package.json b/package.json index 930e464..5ebb5af 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "atm:lint:prettier": "prettier --write" }, "dependencies": { - "@atomist/api-cljs": "^0.4.102" + "@atomist/api-cljs": "^0.4.103" }, "main": "node_modules/@atomist/api-cljs/app.js", "devDependencies": {