From 482a90585ef1f14dfafb63a8efb25a0b58e654bf Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Mon, 8 Mar 2021 18:42:16 -0500 Subject: [PATCH] Try forcing the commit --- .github/workflows/main.yml | 2 -- dist/index.js | 13 ++++++++++++- src/buildExec.ts | 5 +++++ src/index.ts | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c4ccb03..22400e0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,8 +6,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - with: - fetch-depth: 2 - name: Install dependencies run: npm install - name: Lint diff --git a/dist/index.js b/dist/index.js index 453b596..3fa1cdf 100644 --- a/dist/index.js +++ b/dist/index.js @@ -42756,7 +42756,13 @@ strategies.HTTPOrNetworkError = __webpack_require__(951)(strategies.HTTPError, s /***/ }), -/* 690 */, +/* 690 */ +/***/ (function(module) { + +module.exports = eval("require")("@actions/github"); + + +/***/ }), /* 691 */ /***/ (function(module) { @@ -54091,6 +54097,8 @@ function write(key, options) { exports.__esModule = true; var core = __webpack_require__(470); +var github = __webpack_require__(690); +var context = github.context; var isTrue = function (variable) { var lowercase = variable.toLowerCase(); return (lowercase === '1' || @@ -54213,6 +54221,9 @@ var buildExec = function () { if (overrideCommit) { execArgs.push('-C', "" + overrideCommit); } + else { + execArgs.push('-C', "" + context.sha); + } if (overridePr) { execArgs.push('-P', "" + overridePr); } diff --git a/src/buildExec.ts b/src/buildExec.ts index 22dfd29..9892c40 100644 --- a/src/buildExec.ts +++ b/src/buildExec.ts @@ -1,4 +1,7 @@ const core = require('@actions/core'); +const github = require('@actions/github'); + +const context = github.context; const isTrue = (variable) => { const lowercase = variable.toLowerCase(); @@ -128,6 +131,8 @@ const buildExec = () => { } if (overrideCommit) { execArgs.push('-C', `${overrideCommit}`); + } else { + execArgs.push('-C', `${context.sha}`); } if (overridePr) { execArgs.push('-P', `${overridePr}`); diff --git a/src/index.ts b/src/index.ts index cc15bdc..12e2944 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,6 @@ const core = require('@actions/core'); const exec = require('@actions/exec'); + const fs = require('fs'); const request = require('requestretry');