From c73560123db427326b521f69e13eb7d2b8e27329 Mon Sep 17 00:00:00 2001 From: Rob van der Leek <5324924+robvanderleek@users.noreply.github.com> Date: Sun, 7 Apr 2024 00:21:37 +0200 Subject: [PATCH] Use slug and branch in codelimit call --- src/action.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/action.js b/src/action.js index 0d83437..bb468ea 100644 --- a/src/action.js +++ b/src/action.js @@ -73,6 +73,14 @@ async function getChangedFiles(token) { return result; } +function getSourceBranch() { + if (context.eventName === 'pull_request') { + return process.env.GITHUB_HEAD_REF; + } else { + return process.env.GITHUB_REF_NAME; + } +} + (async function main() { const filename = await downloadBinary(); const doUpload = core.getInput('upload') || false; @@ -86,7 +94,9 @@ async function getChangedFiles(token) { console.error('Token for upload not provided.'); exitCode = 1; } - exitCode = await exec(filename, ['upload', '--token', token]); + const slug = context.payload.repository.full_name; + const branch = getSourceBranch(); + exitCode = await exec(filename, ['upload', '--token', token, slug, branch]); } const doCheck = core.getInput('check') || true; if (doCheck && exitCode === 0) {