add: core.addPath()
This commit is contained in:
parent
349881b966
commit
9e04da8578
2 changed files with 6 additions and 12 deletions
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
|
@ -31,6 +31,8 @@ jobs:
|
|||
|
||||
- name: Dump
|
||||
run: |
|
||||
ls -la /usr/local/bin
|
||||
echo ${HOME}
|
||||
ls -la ${HOME}
|
||||
ls -la
|
||||
echo ${PATH}
|
||||
hugo version
|
||||
|
|
14
index.js
14
index.js
|
@ -1,22 +1,11 @@
|
|||
const core = require('@actions/core');
|
||||
// const exec = require('@actions/exec');
|
||||
const tc = require('@actions/tool-cache');
|
||||
const io = require('@actions/io');
|
||||
// const wait = require('./wait');
|
||||
|
||||
|
||||
// most @actions toolkit packages have async methods
|
||||
async function run() {
|
||||
try {
|
||||
// const ms = core.getInput('milliseconds');
|
||||
// console.log(`Waiting ${ms} milliseconds ...`)
|
||||
|
||||
// core.debug((new Date()).toTimeString())
|
||||
// wait(parseInt(ms));
|
||||
// core.debug((new Date()).toTimeString())
|
||||
|
||||
// core.setOutput('time', new Date().toTimeString());
|
||||
|
||||
let hugoVersion = core.getInput('hugo-version');
|
||||
if (!hugoVersion) {
|
||||
// TODO: get latest version of Hugo
|
||||
|
@ -43,6 +32,9 @@ async function run() {
|
|||
|
||||
const hugoPath = '/github/home/bin';
|
||||
await io.mkdirP(hugoPath);
|
||||
core.addPath(hugoPath);
|
||||
|
||||
// Download and extract Hugo binary
|
||||
const hugoTarball = await tc.downloadTool(hugoURL);
|
||||
const hugoExtractedFolder = await tc.extractTar(hugoTarball, '/tmp');
|
||||
core.debug('hugoExtractedFolder:', hugoExtractedFolder);
|
||||
|
|
Loading…
Reference in a new issue