INNER CODE UNIT · JavaScript
verifyReviewGate
rancher/terraform-provider-rancher2 · agent-scripts/gating.js:140
export function verifyReviewGate(targetDir, expectedDiffHash, expectedPlanHash) {
const reviewApprovalFile = path.join(targetDir, 'review-approval.json');
if (!fs.existsSync(reviewApprovalFile)) {
return false;
}
try {
const content = JSON.parse(fs.readFileSync(reviewApprovalFile, 'utf-8'));
if (content.status !== 'approved') {
return false;
}
if (content.plan_hash !== expectedPlanHash) {
return false;
}
if (content.diff_hash !== expectedDiffHash) {
return false;