add: options hugo-version and extended

This commit is contained in:
peaceiris 2019-09-15 20:24:31 +09:00
parent 42a06b08e9
commit 843ac84fed
4 changed files with 36 additions and 8 deletions

View file

@ -1,4 +1,4 @@
name: "Test"
name: 'Test'
on:
push:
@ -8,11 +8,24 @@ on:
jobs:
test:
runs-on: ubuntu-18.04
strategy:
matrix:
hugo-version: ['', 'latest', '0.58.2']
extended: ['', false, true]
steps:
- uses: actions/checkout@v1
- name: Install dependencies
- run: npm ci
- run: npm test
- uses: peaceiris/actions-hugo@migrate-javascript-action
# - name: Test script
# - run: npm test
- name: Test action
uses: peaceiris/actions-hugo@migrate-javascript-action
with:
milliseconds: 1000
hugo-version: ${{ matrix.hugo-version }}
extended: ${{ matrix.extended }}
milliseconds: 100

View file

@ -2,6 +2,14 @@ name: 'Hugo build action'
description: 'GitHub Actions for Hugo extended and Hugo Modules'
author: 'peaceiris'
inputs:
hugo-version:
description: 'The Hugo version to download (if necessary) and use. Example: 0.58.2'
required: false
default: 'latest'
extended:
description: 'Download (if necessary) and use Hugo extended version. Example: true'
required: false
default: 'false'
milliseconds: # id of input
description: 'number of milliseconds to wait'
required: true

View file

@ -13,6 +13,12 @@ async function run() {
core.debug((new Date()).toTimeString())
core.setOutput('time', new Date().toTimeString());
const hugoVersion = core.getInput('hugo-version');
console.log('Hugo version:', hugoVersion);
const extended = core.getInput('extended');
console.log('Hugo extended:', extended);
}
catch (error) {
core.setFailed(error.message);

View file

@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"lint": "eslint index.js",
"test": "eslint index.js && jest"
"test": "eslint index.js && jest",
"build": "npm prune --production"
},
"repository": {
"type": "git",
@ -17,7 +18,7 @@
"JavaScript",
"Hugo"
],
"author": "GitHub",
"author": "peaceiris",
"license": "MIT",
"bugs": {
"url": "https://github.com/peaceiris/actions-hugo/issues"