diff --git a/.github/workflows/auto-comment.yml b/.github/workflows/auto-comment.yml index 7230c4dbb..e5fa9e7c8 100644 --- a/.github/workflows/auto-comment.yml +++ b/.github/workflows/auto-comment.yml @@ -5,6 +5,12 @@ on: types: [opened] pull_request: types: [opened, closed] + pull_request_target: + types: [opened, closed] + +permissions: + issues: write + pull-requests: write jobs: auto_comment: @@ -19,19 +25,40 @@ jobs: const author = context.payload.sender.login; if (context.eventName === 'issues' && context.payload.action === 'opened') { + const issueTitle = context.payload.issue.title.toLowerCase(); + let commentBody; + + if (issueTitle.includes('feat')) { + commentBody = `Hey @${author}! πŸš€ Thanks for this exciting feature idea! + + We love seeing fresh concepts that could take reNgine to the next level. 🌟 + + To help us understand your vision better, could you: + + πŸ“ Provide a detailed description of the feature + 🎯 Explain the problem it solves or the value it adds + πŸ’‘ Share any implementation ideas you might have + + Your input is invaluable in shaping the future of reNgine. Let's innovate together! πŸ’ͺ`; + } else { + commentBody = `Hey @${author}! πŸ‘‹ Thanks for flagging this bug! πŸ›πŸ” + + You're our superhero bug hunter! πŸ¦Έβ€β™‚οΈπŸ¦Έβ€β™€οΈ Before we suit up to squash this bug, could you please: + + πŸ“š Double-check our documentation: https://rengine.wiki + πŸ•΅οΈ Make sure it's not a known issue + πŸ“ Provide all the juicy details about this sneaky bug + + Once again - thanks for your vigilance! πŸ› οΈπŸš€`; + } + github.rest.issues.createComment({ issue_number: context.issue.number, owner, repo, - body: `Hey @${author}! πŸ‘‹ Thanks for flagging this! πŸ›πŸž - - Before we dig in, Let's make sure you have - - πŸ” Gone through the documentation: https://rengine.wiki - πŸ•΅οΈ Make sure it's not a known issue - πŸ“ Provided us all the details related to this bug` + body: commentBody }); - } else if (context.eventName === 'pull_request' && context.payload.action === 'opened') { + } else if ((context.eventName === 'pull_request' || context.eventName === 'pull_request_target') && context.payload.action === 'opened') { github.rest.issues.createComment({ issue_number: context.issue.number, owner, @@ -40,17 +67,32 @@ jobs: Hang tight while we review this! You rock! 🀘` }); - } else if (context.eventName === 'pull_request' && context.payload.action === 'closed') { - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner, - repo, - body: `Holy smokes, @${author}! 🀯 You've just made reNgine even more awesome! + } else if ((context.eventName === 'pull_request' || context.eventName === 'pull_request_target') && context.payload.action === 'closed') { + const isPRMerged = context.payload.pull_request.merged; + let commentBody; + + if (isPRMerged) { + commentBody = `Holy smokes! 🀯 You've just made reNgine even more awesome! Your code is now part of the reNgine hall of fame. πŸ† Keep the cool ideas coming - maybe next time you'll break the internet! πŸ’»πŸ’₯ - Virtual high fives all around! πŸ™Œ` + Virtual high fives all around! πŸ™Œ`; + } else { + commentBody = `Hey, thanks for your contribution! πŸ™ + + We appreciate the time and effort you put into this PR. Sadly this is not the right fit for reNgine at the moment. + + While we couldn't merge it this time, we value your interest in improving reNgine. + + Feel free to reach out if you have any questions. Thanks again!`; + } + + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner, + repo, + body: commentBody }); } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b24f1555d..e0836811a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ ### Security Update -* (Security) CVE-2024-41661 Stored Cross-Site Scripting (XSS) via DNS Record Poisoning reported by @touhidshaikh Advisory https://github.com/yogeshojha/rengine/security/advisories/GHSA-96q4-fj2m-jqf7 +* (Security) CVE-2023-50094 Stored Cross-Site Scripting (XSS) via DNS Record Poisoning reported by @touhidshaikh Advisory https://github.com/yogeshojha/rengine/security/advisories/GHSA-96q4-fj2m-jqf7 ### Bug Fixes @@ -31,7 +31,7 @@ ## What's Changed ### Security update -* (Security) CVE-2024-41661 Fix Authenticated command injection in WAF detection tool reported by @n-thumann Advisory https://github.com/yogeshojha/rengine/security/advisories/GHSA-fx7f-f735-vgh4 +* (Security) CVE-2023-50094 Fix Authenticated command injection in WAF detection tool reported by @n-thumann Advisory https://github.com/yogeshojha/rengine/security/advisories/GHSA-fx7f-f735-vgh4 ### Bug Fixes