Skip to content

Commit

Permalink
chore: 🚧 Store for correct branch
Browse files Browse the repository at this point in the history
  • Loading branch information
robvanderleek committed Dec 2, 2024
1 parent cbe03e4 commit b03d04b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48879,11 +48879,12 @@ function main() {
console.error("Could not determine repository owner or name");
process.exit(1);
}
const branch = getSourceBranch();
yield createReportsBranchIfNotExists(octokit, owner, repo);
const reportContent = getReportContent();
yield (0, github_2.createOrUpdateFile)(octokit, owner, repo, "_codelimit_reports", "main/badge.svg", getBadgeContent(reportContent));
yield (0, github_2.createOrUpdateFile)(octokit, owner, repo, "_codelimit_reports", `${branch}/badge.svg`, getBadgeContent(reportContent));
if (reportContent) {
yield (0, github_2.createOrUpdateFile)(octokit, owner, repo, "_codelimit_reports", "main/report.json", reportContent);
yield (0, github_2.createOrUpdateFile)(octokit, owner, repo, "_codelimit_reports", `${branch}/report.json`, reportContent);
}
let exitCode = 0;
if (doUpload) {
Expand All @@ -48893,7 +48894,6 @@ function main() {
exitCode = 1;
}
const slug = (_a = github_1.context.payload.repository) === null || _a === void 0 ? void 0 : _a.full_name;
const branch = getSourceBranch();
if (slug && branch) {
exitCode = yield (0, exec_1.exec)(filename, ["app", "upload", "--token", token, slug, branch]);
}
Expand Down
6 changes: 3 additions & 3 deletions src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,12 @@ async function main() {
console.error('Could not determine repository owner or name');
process.exit(1);
}
const branch = getSourceBranch();
await createReportsBranchIfNotExists(octokit, owner, repo);
const reportContent = getReportContent();
await createOrUpdateFile(octokit, owner, repo, '_codelimit_reports', 'main/badge.svg', getBadgeContent(reportContent));
await createOrUpdateFile(octokit, owner, repo, '_codelimit_reports', `${branch}/badge.svg`, getBadgeContent(reportContent));
if (reportContent) {
await createOrUpdateFile(octokit, owner, repo, '_codelimit_reports', 'main/report.json', reportContent);
await createOrUpdateFile(octokit, owner, repo, '_codelimit_reports', `${branch}/report.json`, reportContent);
}
let exitCode = 0;
if (doUpload) {
Expand All @@ -157,7 +158,6 @@ async function main() {
exitCode = 1;
}
const slug = context.payload.repository?.full_name;
const branch = getSourceBranch();
if (slug && branch) {
exitCode = await exec(filename, ['app', 'upload', '--token', token, slug, branch]);
}
Expand Down

0 comments on commit b03d04b

Please sign in to comment.