diff --git a/.buildpacks b/.buildpacks old mode 100644 new mode 100755 diff --git a/.dockerignore b/.dockerignore old mode 100644 new mode 100755 diff --git a/.editorconfig b/.editorconfig old mode 100644 new mode 100755 diff --git a/.eslintignore b/.eslintignore old mode 100644 new mode 100755 diff --git a/.eslintrc.yml b/.eslintrc.yml old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.istanbul.yml b/.istanbul.yml old mode 100644 new mode 100755 diff --git a/.travis.yml b/.travis.yml old mode 100644 new mode 100755 diff --git a/CNAME b/CNAME old mode 100644 new mode 100755 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md old mode 100644 new mode 100755 diff --git a/Dockerfile b/Dockerfile old mode 100644 new mode 100755 diff --git a/INSTALL.md b/INSTALL.md old mode 100644 new mode 100755 diff --git a/LICENSE.md b/LICENSE.md old mode 100644 new mode 100755 diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/coverage.svg b/coverage.svg old mode 100644 new mode 100755 diff --git a/doc/TUTORIAL.md b/doc/TUTORIAL.md old mode 100644 new mode 100755 diff --git a/doc/users.md b/doc/users.md old mode 100644 new mode 100755 diff --git a/favicon.png b/favicon.png old mode 100644 new mode 100755 diff --git a/gh-badge.spec.js b/gh-badge.spec.js old mode 100644 new mode 100755 diff --git a/lib/analytics.js b/lib/analytics.js old mode 100644 new mode 100755 diff --git a/lib/badge.js b/lib/badge.js old mode 100644 new mode 100755 diff --git a/lib/badge.spec.js b/lib/badge.spec.js old mode 100644 new mode 100755 diff --git a/lib/color-formatters.js b/lib/color-formatters.js old mode 100644 new mode 100755 diff --git a/lib/colorscheme.json b/lib/colorscheme.json old mode 100644 new mode 100755 diff --git a/lib/github-auth.js b/lib/github-auth.js old mode 100644 new mode 100755 diff --git a/lib/in-process-server-test-helpers.js b/lib/in-process-server-test-helpers.js old mode 100644 new mode 100755 diff --git a/lib/load-logos.js b/lib/load-logos.js old mode 100644 new mode 100755 diff --git a/lib/lru-cache.js b/lib/lru-cache.js old mode 100644 new mode 100755 diff --git a/lib/lru-cache.spec.js b/lib/lru-cache.spec.js old mode 100644 new mode 100755 diff --git a/lib/measure-text.js b/lib/measure-text.js old mode 100644 new mode 100755 diff --git a/lib/php-version.js b/lib/php-version.js old mode 100644 new mode 100755 diff --git a/lib/server-secrets.js b/lib/server-secrets.js old mode 100644 new mode 100755 diff --git a/lib/suggest.js b/lib/suggest.js old mode 100644 new mode 100755 diff --git a/lib/svg-to-img.js b/lib/svg-to-img.js old mode 100644 new mode 100755 diff --git a/lib/svg-to-img.spec.js b/lib/svg-to-img.spec.js old mode 100644 new mode 100755 diff --git a/lib/test-config.js b/lib/test-config.js old mode 100644 new mode 100755 diff --git a/lib/text-formatters.js b/lib/text-formatters.js old mode 100644 new mode 100755 diff --git a/lib/version.js b/lib/version.js old mode 100644 new mode 100755 diff --git a/logo.svg b/logo.svg old mode 100644 new mode 100755 diff --git a/logo/appveyor.svg b/logo/appveyor.svg old mode 100644 new mode 100755 diff --git a/logo/bithound.svg b/logo/bithound.svg old mode 100644 new mode 100755 diff --git a/logo/github.svg b/logo/github.svg old mode 100644 new mode 100755 diff --git a/logo/gitter-white.svg b/logo/gitter-white.svg old mode 100644 new mode 100755 diff --git a/logo/gratipay.svg b/logo/gratipay.svg old mode 100644 new mode 100755 diff --git a/logo/sourcegraph.svg b/logo/sourcegraph.svg old mode 100644 new mode 100755 diff --git a/logo/twitter.svg b/logo/twitter.svg old mode 100644 new mode 100755 diff --git a/package.json b/package.json old mode 100644 new mode 100755 diff --git a/public/404.html b/public/404.html old mode 100644 new mode 100755 diff --git a/public/500.html b/public/500.html old mode 100644 new mode 100755 diff --git a/secret.tpl.json b/secret.tpl.json old mode 100644 new mode 100755 diff --git a/server.js b/server.js old mode 100644 new mode 100755 index 01e68010eb6d15..8cf6b646dcb7bb --- a/server.js +++ b/server.js @@ -3224,12 +3224,12 @@ cache(function(data, match, sendBadge, request) { })); // GitHub issues integration. -camp.route(/^\/github\/issues(-pr)?(-closed)?(-raw)?(-state)?\/([^\/]+)\/([^\/]+)\/?([^\/]+)?\.(svg|png|gif|jpg|json)$/, +camp.route(/^\/github\/issues(-pr)?(-closed)?(-state)?(-raw)?\/([^\/]+)\/([^\/]+)\/?([^\/]+)?\.(svg|png|gif|jpg|json)$/, cache(function(data, match, sendBadge, request) { var isPR = !!match[1]; var isClosed = !!match[2]; - var isRaw = !!match[3]; - var isState = !!match[4]; + var isState = !!match[3]; + var isRaw = !!match[4]; var user = match[5]; // eg, badges var repo = match[6]; // eg, shields var ghLabel = match[7]; // eg, website @@ -3271,11 +3271,19 @@ cache(function(data, match, sendBadge, request) { var modifier = ''; var issues; if (isState && issuesApi) { - var state = data.state; - var id = data.number; - badgeData.text[0] = id; - badgeData.text[1] = state; - badgeData.colorscheme = (state == 'closed')? 'red': 'brightgreen'; + var rightSide = isRaw ? data.state : ' '.repeat(2) + data.title + ' '.repeat(2); + var leftSide = ' '.repeat(2) +'#' + ghLabel + ' '.repeat(2); + if (data.state !== 'undefined') { + console.log("data.state !== 'undefined'", true) + badgeData.link = [ data.html_url ] + badgeData.colorscheme = (data.state == 'closed') ? 'red': 'brightgreen'; + } else { + console.log("data.state !== 'undefined'", false) + rightSide = 'Not Found' + badgeData.colorscheme = 'lightgrey' + } + badgeData.text[0] = leftSide; + badgeData.text[1] = rightSide; sendBadge(format, badgeData); } else { if (isPR) { diff --git a/server.spec.js b/server.spec.js old mode 100644 new mode 100755 diff --git a/service-tests/README.md b/service-tests/README.md old mode 100644 new mode 100755 diff --git a/service-tests/cran.js b/service-tests/cran.js old mode 100644 new mode 100755 diff --git a/service-tests/discord.js b/service-tests/discord.js old mode 100644 new mode 100755 diff --git a/service-tests/github.js b/service-tests/github.js old mode 100644 new mode 100755 diff --git a/service-tests/maven-central.js b/service-tests/maven-central.js old mode 100644 new mode 100755 diff --git a/service-tests/runner/cli.js b/service-tests/runner/cli.js old mode 100644 new mode 100755 diff --git a/service-tests/runner/runner.js b/service-tests/runner/runner.js old mode 100644 new mode 100755 diff --git a/service-tests/runner/service-tester.js b/service-tests/runner/service-tester.js old mode 100644 new mode 100755 diff --git a/shields.example.env b/shields.example.env old mode 100644 new mode 100755 diff --git a/spec/SPECIFICATION.md b/spec/SPECIFICATION.md old mode 100644 new mode 100755 diff --git a/spec/proportions.png b/spec/proportions.png old mode 100644 new mode 100755 diff --git a/templates/default-template.json b/templates/default-template.json old mode 100644 new mode 100755 diff --git a/templates/flat-square-template.svg b/templates/flat-square-template.svg old mode 100644 new mode 100755 diff --git a/templates/flat-template.svg b/templates/flat-template.svg old mode 100644 new mode 100755 diff --git a/templates/plastic-template.svg b/templates/plastic-template.svg old mode 100644 new mode 100755 diff --git a/templates/social-template.svg b/templates/social-template.svg old mode 100644 new mode 100755 diff --git a/try.html b/try.html old mode 100644 new mode 100755 index 37f1f9f5824de6..77e826c919219b --- a/try.html +++ b/try.html @@ -762,9 +762,13 @@
https://img.shields.io/github/issues-raw/badges/shields.svg
https://img.shields.io/github/issues-state/badges/shields/1.svg
https://img.shields.io/github/issues-state/badges/shields/1012.svg
https://img.shields.io/github/issues-state-raw/badges/shields/1.svg