diff --git a/action.yml b/action.yml index e0ecdd7..1b1a063 100644 --- a/action.yml +++ b/action.yml @@ -86,6 +86,11 @@ inputs: long-paths: description: Enable core.longpath support default: true + +output: + ref: + description: The SHA1 ref that was checked out + runs: using: node16 main: dist/index.js diff --git a/dist/index.js b/dist/index.js index 69214fd..f10ed44 100644 --- a/dist/index.js +++ b/dist/index.js @@ -32007,7 +32007,8 @@ function getSource(settings) { // Get commit information const commitInfo = yield git.log1(); // Log commit sha - yield git.log1("--format='%H'"); + const commit = yield git.log1("--format='%H'"); + core.setOutput('ref', commit.replaceAll("'", '').trim()); // Check for incorrect pull request merge commit yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.githubServerUrl); } diff --git a/src/git-source-provider.ts b/src/git-source-provider.ts index 54eb6bf..2051aee 100644 --- a/src/git-source-provider.ts +++ b/src/git-source-provider.ts @@ -278,7 +278,8 @@ export async function getSource(settings: IGitSourceSettings): Promise { const commitInfo = await git.log1() // Log commit sha - await git.log1("--format='%H'") + const commit = await git.log1("--format='%H'") + core.setOutput('ref', commit.replaceAll("'", '').trim()) // Check for incorrect pull request merge commit await refHelper.checkCommitInfo( diff --git a/tsconfig.json b/tsconfig.json index b0ff5f7..a495ec4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,7 @@ "target": "es6", "module": "commonjs", "lib": [ - "es6" + "es2021" ], "outDir": "./lib", "rootDir": "./src",