Skip to content

Commit

Permalink
Fix detection of missing amendment
Browse files Browse the repository at this point in the history
  • Loading branch information
dontcallmedom committed Sep 2, 2024
1 parent e867bff commit 4500403
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/check-rec-amendment.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ module.exports = async ({github, context, core}) => {
}
const amendments = require(process.env.GITHUB_WORKSPACE + '/amendments.json');
const prAmendmentSection = Object.values(amendments).find(list => list.find(a => Array.isArray(a.pr) ? a.pr.includes(context.issue.number) : a.pr === context.issue.number ));
const prAmendment = prAmendmentSection.find(a => Array.isArray(a.pr) ? a.pr.includes(context.issue.number) : a.pr === context.issue.number );
if (!prAmendment) {
if (!prAmendmentSection) {
core.setFailed(`Pull request ${context.issue.number} not labeled as editorial and not referenced in amendments.json`);
}
const prAmendment = prAmendmentSection.find(a => Array.isArray(a.pr) ? a.pr.includes(context.issue.number) : a.pr === context.issue.number );
if (!prAmendment.testUpdates || !prAmendment.testUpdates.length === 0) {
core.setFailed(`Pull request ${context.issue.number} declares an amendment but does not document its test status in testUpdates`);
}
Expand Down

0 comments on commit 4500403

Please sign in to comment.