@@ -52,51 +52,34 @@ runs:
52
52
let streamPathMap = new Map();
53
53
54
54
const slackStream = process.env.SLACK_STREAM;
55
- console.log(`DEBUG: slackStream input value: "${slackStream}"`);
56
- console.log(`DEBUG: slackStream input length: ${slackStream ? slackStream.length : 0}`);
57
- console.log(`DEBUG: slackStream input type: ${typeof slackStream}`);
58
- console.log(`DEBUG: slackStream input truthy: ${!!slackStream}`);
59
55
if (slackStream) {
60
56
slackStreams.add(slackStream);
61
- console.log(`DEBUG: Added direct slackStream: ${slackStream}`);
62
- } else {
63
- console.log(`DEBUG: slackStream is falsy, not adding to streams`);
64
57
}
65
58
66
59
const pathToSlackStreamMapping = process.env.PATH_TO_SLACK_STREAM_MAPPING;
67
- console.log(`DEBUG: pathToSlackStreamMapping input value: "${pathToSlackStreamMapping}"`);
68
60
if (pathToSlackStreamMapping) {
69
61
try {
70
62
const parsedMapping = JSON.parse(pathToSlackStreamMapping);
71
- console.log(`DEBUG: Parsed mapping:`, JSON.stringify(parsedMapping, null, 2));
72
-
73
63
const files = await github.paginate(github.rest.pulls.listFiles, {
74
64
owner: context.repo.owner,
75
65
repo: context.repo.repo,
76
66
pull_number: pr.number,
77
67
});
78
- console.log(`DEBUG: Found ${files.length} changed files.`);
79
- console.log(`DEBUG: Changed files:`, files.map(f => f.filename));
80
-
68
+ console.log(`Found ${files.length} changed files.`);
81
69
for (const file of files) {
82
70
for (const [path, slackStream] of Object.entries(parsedMapping)) {
83
- console.log(`DEBUG: Checking if file "${file.filename}" starts with path "${path}"`);
84
71
if (file.filename.startsWith(path)) {
85
- console.log(`DEBUG: Match found! Adding stream for: ${file.filename} -> ${slackStream}`);
72
+ console.log(`Add stream for: ${file.filename}`)
86
73
slackStreams.add(slackStream);
87
74
streamPathMap.set(slackStream, path);
88
75
}
89
76
}
90
77
}
91
78
} catch (error) {
92
- console.error('DEBUG: Failed to parse pathToSlackStreamMapping JSON:', error);
93
- console.log('DEBUG: Skipping path-based stream mapping due to invalid JSON');
79
+ console.error('Failed to parse pathToSlackStreamMapping JSON:', error);
94
80
}
95
81
}
96
82
97
- console.log(`DEBUG: Final slackStreams size: ${slackStreams.size}`);
98
- console.log(`DEBUG: Final slackStreams:`, Array.from(slackStreams));
99
-
100
83
if (slackStreams.size === 0) {
101
84
console.log("No Slack streams configured for notification.");
102
85
return;
0 commit comments