add: options hugo-version and extended
This commit is contained in:
parent
42a06b08e9
commit
843ac84fed
4 changed files with 36 additions and 8 deletions
21
.github/workflows/test.yml
vendored
21
.github/workflows/test.yml
vendored
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
10
index.js
10
index.js
|
@ -4,7 +4,7 @@ const wait = require('./wait');
|
|||
|
||||
// most @actions toolkit packages have async methods
|
||||
async function run() {
|
||||
try {
|
||||
try {
|
||||
const ms = core.getInput('milliseconds');
|
||||
console.log(`Waiting ${ms} milliseconds ...`)
|
||||
|
||||
|
@ -13,7 +13,13 @@ 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);
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue