Skip to content

Commit 58c7162

Browse files
vaindclaude
andcommitted
Log author_association and use consistent comment style
Add debug log of the actual author_association value before the internal/external check, making it easier to troubleshoot unexpected association values. Also normalize comment style to /// to match the rest of the file. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 0d3dbfb commit 58c7162

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

danger/dangerfile-utils.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ const PR_TEMPLATE_PATHS = [
117117
'.github/PULL_REQUEST_TEMPLATE/pull_request_template.md'
118118
];
119119

120-
/** Collapse all whitespace runs into single spaces for comparison. */
120+
/// Collapse all whitespace runs into single spaces for comparison.
121121
function normalizeWhitespace(str) {
122122
return str.replace(/\s+/g, ' ').trim();
123123
}
124124

125-
/** Try each known PR template path and return the first one with content. */
125+
/// Try each known PR template path and return the first one with content.
126126
async function findPRTemplate(danger) {
127127
for (const templatePath of PR_TEMPLATE_PATHS) {
128128
const content = await danger.github.utils.fileContents(templatePath);
@@ -134,7 +134,7 @@ async function findPRTemplate(danger) {
134134
return null;
135135
}
136136

137-
/** Build a markdown hint showing the expected boilerplate text. */
137+
/// Build a markdown hint showing the expected boilerplate text.
138138
function formatBoilerplateHint(title, description, expectedBoilerplate) {
139139
return `### ⚖️ ${title}
140140
@@ -147,14 +147,13 @@ ${expectedBoilerplate}
147147
This is required to ensure proper intellectual property rights for your contributions.`;
148148
}
149149

150-
/**
151-
* Check that external contributors include the required legal boilerplate in their PR body.
152-
* Accepts danger context and reporting functions as parameters for testability.
153-
*/
150+
/// Check that external contributors include the required legal boilerplate in their PR body.
151+
/// Accepts danger context and reporting functions as parameters for testability.
154152
async function checkLegalBoilerplate({ danger, fail, markdown }) {
155153
console.log('::debug:: Checking legal boilerplate requirements...');
156154

157155
const authorAssociation = danger.github.pr.author_association;
156+
console.log(`::debug:: PR author_association: ${authorAssociation}`);
158157
if (INTERNAL_ASSOCIATIONS.includes(authorAssociation)) {
159158
console.log('::debug:: Skipping legal boilerplate check for organization member/collaborator');
160159
return;

0 commit comments

Comments
 (0)