@@ -17977,6 +17977,17 @@ const getJobType = (job) => {
17977
17977
}
17978
17978
return 'unknown';
17979
17979
};
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
+ };
17980
17991
const run = (jobID) => __awaiter(void 0, void 0, void 0, function* () {
17981
17992
core.info(`Job ID: ${jobID}`);
17982
17993
let job = yield (0, lib_1.get)(jobID);
@@ -17991,16 +18002,19 @@ const run = (jobID) => __awaiter(void 0, void 0, void 0, function* () {
17991
18002
return {
17992
18003
isApproved: isApproved(job),
17993
18004
isSuggested: isSuggested(job),
17994
- jobType: getJobType(job)
18005
+ jobType: getJobType(job),
18006
+ confidence: getConfidence(job)
17995
18007
};
17996
18008
});
17997
18009
const jobID = (0, lib_1.required)('codeball-job-id');
17998
18010
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* () {
18000
18012
yield (0, track_1.track)({ jobID, actionName: 'status' });
18001
18013
core.setOutput('approved', isApproved);
18002
18014
core.setOutput('suggested', isSuggested);
18003
18015
core.setOutput('jobType', jobType);
18016
+ core.setOutput('confidence', confidence.toFixed(3));
18017
+ core.info(`Confidence: ${confidence.toFixed(3)}`);
18004
18018
}))
18005
18019
.catch((error) => __awaiter(void 0, void 0, void 0, function* () {
18006
18020
if (error instanceof Error) {
0 commit comments