Skip to content

Commit 1d99c45

Browse files
committed
Build action
1 parent 79f37eb commit 1d99c45

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

dist/status/index.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17977,6 +17977,17 @@ const getJobType = (job) => {
1797717977
}
1797817978
return 'unknown';
1797917979
};
17980+
const getConfidence = (job) => {
17981+
var _a, _b;
17982+
if ((0, lib_1.isContributionJob)(job)) {
17983+
const probabilities = (_b = (_a = job.contribution) === null || _a === void 0 ? void 0 : _a.predicted_outcome) === null || _b === void 0 ? void 0 : _b.file_probabilities;
17984+
if (probabilities) {
17985+
return Math.min(...probabilities);
17986+
}
17987+
return 0;
17988+
}
17989+
return 0;
17990+
};
1798017991
const run = (jobID) => __awaiter(void 0, void 0, void 0, function* () {
1798117992
core.info(`Job ID: ${jobID}`);
1798217993
let job = yield (0, lib_1.get)(jobID);
@@ -17991,16 +18002,19 @@ const run = (jobID) => __awaiter(void 0, void 0, void 0, function* () {
1799118002
return {
1799218003
isApproved: isApproved(job),
1799318004
isSuggested: isSuggested(job),
17994-
jobType: getJobType(job)
18005+
jobType: getJobType(job),
18006+
confidence: getConfidence(job)
1799518007
};
1799618008
});
1799718009
const jobID = (0, lib_1.required)('codeball-job-id');
1799818010
run(jobID)
17999-
.then(({ isApproved, isSuggested, jobType }) => __awaiter(void 0, void 0, void 0, function* () {
18011+
.then(({ isApproved, isSuggested, jobType, confidence }) => __awaiter(void 0, void 0, void 0, function* () {
1800018012
yield (0, track_1.track)({ jobID, actionName: 'status' });
1800118013
core.setOutput('approved', isApproved);
1800218014
core.setOutput('suggested', isSuggested);
1800318015
core.setOutput('jobType', jobType);
18016+
core.setOutput('confidence', confidence.toFixed(3));
18017+
core.info(`Confidence: ${confidence.toFixed(3)}`);
1800418018
}))
1800518019
.catch((error) => __awaiter(void 0, void 0, void 0, function* () {
1800618020
if (error instanceof Error) {

dist/status/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)