diff --git a/main.js b/main.js index b0c43f06..a9869c47 100644 --- a/main.js +++ b/main.js @@ -31,6 +31,22 @@ async function main() { console.log("==> Conclusion:", workflowConclusion) + const uniqueInputSets = [ + { + "pr": pr, + "commit": commit, + "branch": branch, + "run_id": runID + } + ] + uniqueInputSets.forEach((inputSet) => { + const inputs = Object.values(inputSet) + const providedInputs = inputs.filter(input => input !== '') + if (providedInputs.length > 1) { + throw new Error(`The following inputs cannot be used together: ${Object.keys(inputSet).join(", ")}`) + } + }) + if (pr) { console.log("==> PR:", pr)