Skip to content

Commit

Permalink
Use slug and branch in codelimit call
Browse files Browse the repository at this point in the history
  • Loading branch information
robvanderleek committed Apr 6, 2024
1 parent 8d59284 commit c735601
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down

0 comments on commit c735601

Please sign in to comment.