Created
May 26, 2025 14:22
-
-
Save smitmartijn/4717c9f416a0d386dc61339c115f9f2c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fullTextRaw = $json["body"]["text"] || ""; | |
const fullText = fullTextRaw.trim(); // remove leading/trailing whitespace | |
const lines = fullText.split('\n').map(line => line.trim()); | |
// Look for lines | |
const summaryLine = lines.find(line => line.includes("Cloudflare Pages:")); | |
const commitLine = lines.find(line => line.startsWith("Commit Hash:")); | |
const envLine = lines.find(line => line.startsWith("Environment:")); | |
// If any line is missing, exit the workflow | |
if (!summaryLine || !commitLine || !envLine) { | |
return ""; // returning an empty array stops further execution | |
} | |
const filteredMessage = [summaryLine, commitLine, envLine].join('\n'); | |
return { | |
json: { | |
message: filteredMessage | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment