This commit is contained in:
Corey Butler
2019-09-02 17:46:08 -05:00
parent c9bb092cbc
commit 4c27ef90b4
24 changed files with 1546 additions and 6 deletions

View File

@ -1,16 +1,19 @@
// import * as core from '@actions/core';
const github = require('@actions/github')
const core = require('@actions/core')
const exec = require('@actions/exec')
const io = require('@actions/io')
const fs = require('fs')
const path = require('path')
async function run() {
try {
const gitpath = await io.which('git', true)
await exec.exec(`"${gitpath}"`, ['fetch'])
await exec.exec(`"${gitpath}"`, ['checkout', process.env.GITHUB_SHA])
// await exec.exec(`git fetch && git checkout ${process.env.GITHUB_SHA}`)
// const myToken = core.getInput('myToken');
// const octokit = new github.GitHub(myToken)
// const myInput = core.getInput('myInput')
// core.debug(`Hello ${myInput}`)
core.warning(process.env.INPUT_GITHUB_TOKEN)
const git = new github.GitHub(process.env.INPUT_GITHUB_TOKEN)
core.warning(` Available environment variables:\n -> ${Object.keys(process.env).map(i => i + ' :: ' + process.env[i]).join('\n -> ')}`)
let dir = fs.readdirSync(path.resolve(process.env.GITHUB_WORKSPACE), { withFileTypes: true }).map(entry => {
@ -25,7 +28,11 @@ async function run() {
// core.warning(` Alt Working Directory: ${process.env.RUNNER_WORKSPACE}:\n${dir2}`)
console.log(fs.readFileSync(path.join(process.env.GITHUB_WORKSPACE, 'package.json')).toString())
let pkg = require(fs.readFileSync(path.join(process.env.GITHUB_WORKSPACE, 'package.json')))
core.warning(` ${pkg.version}`)
git.
core.setOutput('tag', '')
} catch (error) {