From deed20fab37d41201f34cd9ba5cbbce8f3130528 Mon Sep 17 00:00:00 2001 From: timruffles Date: Fri, 20 Dec 2019 12:22:23 +0000 Subject: [PATCH] Automated deployment: Fri Dec 20 12:22:23 UTC 2019 5222a0fbf71a66d3bbe2d8ef59f551443ba902b4 --- .github/workflows/ci.yml | 13 ------- Dockerfile | 11 ------ action.js | 63 --------------------------------- actions.yml | 11 ------ humans.txt.yaml | 4 --- index.html | 1 - package-lock.json | 76 ---------------------------------------- package.json | 7 ---- run.sh | 3 -- test.sh | 10 ------ 10 files changed, 199 deletions(-) delete mode 100644 .github/workflows/ci.yml delete mode 100644 Dockerfile delete mode 100644 action.js delete mode 100644 actions.yml delete mode 100644 humans.txt.yaml delete mode 100644 index.html delete mode 100644 package-lock.json delete mode 100644 package.json delete mode 100644 run.sh delete mode 100755 test.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 42ef490..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,13 +0,0 @@ -on: - push: - branches: ["**"] - - -jobs: - ci: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: npm install --production - - run: "./test.sh" - diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index eac45d9..0000000 --- a/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM node:12 - -WORKDIR /opt/humans.txt - -COPY . /opt/humans.txt - -RUN npm i --production - -ENV FORCE_COLOR=3 - -ENTRYPOINT ["bash", "/opt/humans.txt/run.sh"] diff --git a/action.js b/action.js deleted file mode 100644 index 4aec587..0000000 --- a/action.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict' - -const fs = require('fs') -const yaml = require('yaml') -const chalk = require('chalk') - -const formatters = { - txt: txtFormatter, - json: jsonFormatter, - shell: (data) => txtFormatter(data, { colors: true}), -} - -main() - -function main() { - const format = process.argv[2] || ((process.env.GITHUB_ACTION || process.stdout.isTTY) ? "shell" : "txt") - - const formatter = formatters[format] - if (!formatter) { - invalidFormat(format) - return - } - - const data = yaml.parse(fs.readFileSync("./humans.txt.yaml", {encoding: "utf8"})) - - formatter(data) -} - -function invalidFormat(format) { - const list = Object.keys(formatters).sort().join(",") - console.error(`'${format}' is not one of the accepted formats ${list}`) - process.statusCode = 1 - return -} - -function jsonFormatter({humans}) { - console.log(JSON.stringify(humans, null, 4)) -} - -function txtFormatter({humans}, {colors = false} = {}) { - let active = humans.filter(h => !h.alum).map(h => h.name) - let alum = humans.filter(h => h.alum).map(h => h.name) - - if(colors) { - const total = active.length + alum.length - active = mapColorRange(active, 0, total) - alum = mapColorRange(alum, active.length, total) - } - - console.log("Current humans") - console.log("==============\n") - console.log(active.join("\n")) - console.log("\n") - - console.log("Human alumni") - console.log("============\n") - console.log(alum.join("\n")) -} - -function mapColorRange(strings, base, total) { - return strings.map((n, i) => chalk.hsl(((i + base) / total) * 360, 100, 50)(n)) -} - diff --git a/actions.yml b/actions.yml deleted file mode 100644 index 229990a..0000000 --- a/actions.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: 'GitHub Actions humans.txt' -description: 'List out the humans who help feed and tend the robots of GitHub Actions' -inputs: - format: - description: 'How to output the people of actions - txt, json or ascii' - default: 'ascii' -runs: - using: 'docker' - image: 'Dockerfile' - args: - - ${{ inputs.format }} diff --git a/humans.txt.yaml b/humans.txt.yaml deleted file mode 100644 index ae8fca6..0000000 --- a/humans.txt.yaml +++ /dev/null @@ -1,4 +0,0 @@ -humans: -- name: Mona Lisa Octocat - honorary_human: true - diff --git a/index.html b/index.html deleted file mode 100644 index 355cffb..0000000 --- a/index.html +++ /dev/null @@ -1 +0,0 @@ -Is this thing on? diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 62d2acb..0000000 --- a/package-lock.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "requires": true, - "lockfileVersion": 1, - "dependencies": { - "@babel/runtime": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.7.7.tgz", - "integrity": "sha512-uCnC2JEVAu8AKB5do1WRIsvrdJ0flYx/A/9f/6chdacnEZ7LmavjdsDXr5ksYBegxtuTPR5Va9/+13QF/kFkCA==", - "requires": { - "regenerator-runtime": "^0.13.2" - } - }, - "@types/color-name": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==" - }, - "ansi-styles": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.0.tgz", - "integrity": "sha512-7kFQgnEaMdRtwf6uSfUnVr9gSGC7faurn+J/Mv90/W+iTtN0405/nLdopfMWwchyxhbGYl6TC4Sccn9TUkGAgg==", - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "regenerator-runtime": { - "version": "0.13.3", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", - "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==" - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "requires": { - "has-flag": "^4.0.0" - } - }, - "yaml": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.7.2.tgz", - "integrity": "sha512-qXROVp90sb83XtAoqE8bP9RwAkTTZbugRUTm5YeFCBfNRPEp2YzTeqWiz7m5OORHzEvrA/qcGS8hp/E+MMROYw==", - "requires": { - "@babel/runtime": "^7.6.3" - } - } - } -} diff --git a/package.json b/package.json deleted file mode 100644 index afa6d5f..0000000 --- a/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "private": true, - "dependencies": { - "chalk": "3.0.0", - "yaml": "1.7.2" - } -} diff --git a/run.sh b/run.sh deleted file mode 100644 index a2c6303..0000000 --- a/run.sh +++ /dev/null @@ -1,3 +0,0 @@ -cd /opt/humans.txt - -node action.js $@ \ No newline at end of file diff --git a/test.sh b/test.sh deleted file mode 100755 index 22f7736..0000000 --- a/test.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -set -xeuo pipefail - -node action.js json >/dev/null -node action.js txt -# check default arg -node action.js >/dev/null -node action.js shell -