Commit d85bb85dce5 for woocommerce
commit d85bb85dce5c5852a5f783e4c380961f6c8ef15b
Author: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>
Date: Wed Dec 2 15:20:09 2026 +0200
Harden Slack message formatting in the CFE/PRR workflow (#71720)
Escape issue titles in CFE/PRR Slack messages
Replace &, < and > in the issue title before it goes into a Slack
message, so Slack shows the title as plain text. Pass the issue comment
to the shell in an environment variable, not inline.
diff --git a/.github/workflows/release-cfe-prr-issue-validation.yml b/.github/workflows/release-cfe-prr-issue-validation.yml
index 4d6d5a56382..19893506527 100644
--- a/.github/workflows/release-cfe-prr-issue-validation.yml
+++ b/.github/workflows/release-cfe-prr-issue-validation.yml
@@ -61,7 +61,7 @@ jobs:
with:
script: |
const issueUrl = context.payload.issue.html_url;
- const issueTitle = context.payload.issue.title;
+ const issueTitle = context.payload.issue.title.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
const labelName = context.payload.label?.name;
let prData;
@@ -136,7 +136,7 @@ jobs:
with:
script: |
const issueUrl = context.payload.issue.html_url;
- const issueTitle = context.payload.issue.title;
+ const issueTitle = context.payload.issue.title.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
const labelName = context.payload.label?.name;
const baseRef = process.env.PR_BASE_REF;
@@ -189,8 +189,9 @@ jobs:
env:
ISSUE_URL: ${{ github.event.issue.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ GITHUB_COMMENT: ${{ steps.verify-pr.outputs.GITHUB_COMMENT || steps.extract-release.outputs.GITHUB_COMMENT }}
run: |
- gh issue close "$ISSUE_URL" --comment "${{ steps.verify-pr.outputs.GITHUB_COMMENT || steps.extract-release.outputs.GITHUB_COMMENT }}"
+ gh issue close "$ISSUE_URL" --comment "$GITHUB_COMMENT"
apply-milestone:
if: github.event.label.name == 'code freeze exception' || github.event.label.name == 'point release request' || github.event.label.name == 'Approved' || github.event.label.name == 'Rejected'
@@ -228,7 +229,7 @@ jobs:
script: |
const event = context.payload;
const labelName = event.label?.name;
- const issueTitle = event.issue.title;
+ const issueTitle = event.issue.title.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
const issueUrl = event.issue.html_url;
const releaseNumber = process.env.RELEASE_NUMBER;
@@ -254,8 +255,9 @@ jobs:
env:
ISSUE_URL: ${{ github.event.issue.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ GITHUB_COMMENT: ${{ steps.set-message.outputs.GITHUB_COMMENT }}
run: |
- gh issue comment "$ISSUE_URL" --body "${{ steps.set-message.outputs.GITHUB_COMMENT }}"
+ gh issue comment "$ISSUE_URL" --body "$GITHUB_COMMENT"
request-approved:
if: ${{ github.event.label.name == 'Approved' }}
@@ -320,7 +322,7 @@ jobs:
with:
script: |
const event = context.payload;
- const issueTitle = event.issue.title;
+ const issueTitle = event.issue.title.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
const issueUrl = event.issue.html_url;
const message = `:done-3: *CFE/PRR request approved:* _<${issueUrl}|${issueTitle}>_`;
@@ -357,7 +359,7 @@ jobs:
with:
script: |
const event = context.payload;
- const issueTitle = event.issue.title;
+ const issueTitle = event.issue.title.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
const issueUrl = event.issue.html_url;
const message = `:x: *CFE/PRR request rejected:* _<${issueUrl}|${issueTitle}>_`;