html mode
This commit is contained in:
4
.github/workflows/deploy.yml
vendored
4
.github/workflows/deploy.yml
vendored
@@ -10,8 +10,8 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: ./
|
||||
with:
|
||||
format: txt
|
||||
output: ./humans.txt
|
||||
format: html
|
||||
output: ./gh-pages/index.html
|
||||
- uses: peaceiris/actions-gh-pages@v2
|
||||
env:
|
||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
|
||||
10
action.js
10
action.js
@@ -6,6 +6,7 @@ const chalk = require('chalk')
|
||||
|
||||
const formatters = {
|
||||
txt: txtFormatter,
|
||||
html: htmlFormatter,
|
||||
json: jsonFormatter,
|
||||
shell: (data, opts) => txtFormatter(data, { ...opts, colors: true}),
|
||||
}
|
||||
@@ -62,3 +63,12 @@ function mapColorRange(strings, base, total) {
|
||||
return strings.map((n, i) => chalk.hsl(((i + base) / total) * 360, 100, 50)(n))
|
||||
}
|
||||
|
||||
function htmlFormatter(data, opts) {
|
||||
fs.writeSync(opts.output, `<!doctype html>
|
||||
<meta charset='utf8' />
|
||||
<title>Actions - humans.txt</title>
|
||||
<body><pre>
|
||||
`)
|
||||
txtFormatter(data, opts)
|
||||
fs.writeSync(opts.output, "</pre></body>")
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ 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'
|
||||
description: 'How to output the people of actions - txt, json, html or ascii'
|
||||
default: 'ascii'
|
||||
output:
|
||||
description: 'Where to output the file - stdout otherwise'
|
||||
|
||||
Reference in New Issue
Block a user