From 9e04da8578e841bb2957bb55fe1199ccc7e2de82 Mon Sep 17 00:00:00 2001 From: peaceiris <30958501+peaceiris@users.noreply.github.com> Date: Mon, 16 Sep 2019 02:06:57 +0900 Subject: [PATCH] add: core.addPath() --- .github/workflows/test.yml | 4 +++- index.js | 14 +++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d713931..f67c3f1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,6 +31,8 @@ jobs: - name: Dump run: | - ls -la /usr/local/bin + echo ${HOME} + ls -la ${HOME} + ls -la echo ${PATH} hugo version diff --git a/index.js b/index.js index 8ab6369..6c2e13e 100644 --- a/index.js +++ b/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);