Commit ef7555d86cc for woocommerce
commit ef7555d86cc1f188d009fa614f49bcf9e490827a
Author: Brian Coords <bacoords@gmail.com>
Date: Fri Aug 14 14:50:07 2026 -0700
Replace release communication AI with label-only workflow (#67734)
* Replace release communication AI with label workflow
* Fix label permissions and checkbox matching
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 203d41dd8ae..83564e28c9b 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -118,7 +118,7 @@ Using the [WooCommerce Testing Instructions Guide](https://developer.woocommerce
### Release Communication
<!-- release-communication-section -->
-Select if this PR needs a generated summary for release notes:
+Select the release communication labels this PR needs:
- [ ] **Feature Highlight** - For user-facing features (what changed, user impact)
- [ ] **Developer Advisory** - For developer-facing changes (what changed, how to detect, actions needed)
@@ -127,12 +127,14 @@ Select if this PR needs a generated summary for release notes:
<summary>When to use each?</summary>
**Feature Highlight**: New features, UI changes, or improvements that merchants/store owners will notice.
+
- Example: "New bulk editing for products", "Improved checkout performance"
**Developer Advisory**: Breaking changes, deprecations, or changes that affect themes/plugins/extensions.
+
- Example: "Hook signature change", "Deprecated filter", "REST API field removed"
-An AI will analyze your PR and post a draft comment for you to review and edit.
+Selected labels are applied when the pull request is merged.
</details>
### Use of AI Tools
diff --git a/.github/workflows/pr-release-communication-labels.yml b/.github/workflows/pr-release-communication-labels.yml
new file mode 100644
index 00000000000..18904e82c6b
--- /dev/null
+++ b/.github/workflows/pr-release-communication-labels.yml
@@ -0,0 +1,46 @@
+name: 'PR release communication labels'
+
+on:
+ pull_request_target:
+ types: [closed]
+
+concurrency:
+ group: release-communication-labels-${{ github.event.pull_request.number }}
+ cancel-in-progress: true
+
+jobs:
+ apply-labels:
+ name: Apply release communication labels
+ if: |
+ github.event.pull_request.merged == true &&
+ (
+ contains(github.event.pull_request.body, '[x] **Feature Highlight**') ||
+ contains(github.event.pull_request.body, '[x] **Developer Advisory**')
+ )
+ runs-on: ubuntu-latest
+ timeout-minutes: 5
+ permissions:
+ pull-requests: write
+
+ steps:
+ - name: Apply selected labels
+ uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
+ with:
+ script: |
+ const body = (context.payload.pull_request.body || '').toLowerCase();
+ const labels = [];
+
+ if (body.includes('[x] **feature highlight**')) {
+ labels.push('feature highlight');
+ }
+
+ if (body.includes('[x] **developer advisory**')) {
+ labels.push('developer advisory');
+ }
+
+ await github.rest.issues.addLabels({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: context.issue.number,
+ labels,
+ });
diff --git a/.github/workflows/pr-release-communication.yml b/.github/workflows/pr-release-communication.yml
deleted file mode 100644
index c65083eddbe..00000000000
--- a/.github/workflows/pr-release-communication.yml
+++ /dev/null
@@ -1,285 +0,0 @@
-name: PR Release Communication
-
-on:
- pull_request_target:
- types: [closed]
-
-concurrency:
- group: release-comm-${{ github.event.pull_request.number }}
- cancel-in-progress: true
-
-jobs:
- # ─────────────────────────────────────────────────────────────
- # JOB 1: Feature Highlights (for users/merchants)
- # ─────────────────────────────────────────────────────────────
- feature-highlight:
- name: Generate Feature Highlight
- if: |
- github.event.pull_request.merged == true &&
- contains(github.event.pull_request.body, '[x] **Feature Highlight**')
- runs-on: ubuntu-latest
- timeout-minutes: 10
- permissions:
- contents: read
- pull-requests: write
- id-token: write
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
-
- - name: Add Feature Highlight label
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- with:
- script: |
- await github.rest.issues.addLabels({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.issue.number,
- labels: ['feature highlight']
- });
-
- - name: Generate Feature Highlight
- id: highlight
- uses: anthropics/claude-code-action@e90deca47693f9457b72f2b53c17d7c445a87342 # v1.0.171
- with:
- anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
- claude_args: >
- --allowedTools "Bash(gh pr diff:*),Bash(gh pr view:*)"
- --json-schema '{"type":"object","properties":{"title":{"type":"string"},"what_changed":{"type":"string"},"user_impact":{"type":"string"}},"required":["title","what_changed","user_impact"]}'
- prompt: |
- Feature Highlight Generator for WooCommerce
-
- REPO: ${{ github.repository }}
- PR: #${{ github.event.pull_request.number }}
-
- OBJECTIVE
- Generate a feature highlight for release notes and announcements.
-
- OUTPUT FORMAT (JSON)
- - title: Short, catchy title (5-10 words)
- - what_changed: 2-3 sentences describing the changes
- - user_impact: 2-3 sentences explaining benefits for store owners/merchants
-
- METHOD
- 1. gh pr view ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --json title,body
- 2. gh pr diff ${{ github.event.pull_request.number }} --repo ${{ github.repository }}
-
- ANALYSIS GUIDELINES
-
- Title:
- - Keep to 1-3 sentences
- - Lead with the user/merchant impact
- - Avoid internal implementation details (file names, test coverage, etc.)
- - Write as if for a changelog or newsletter audience
- - Focus on "what's different now" not "what code changed"
-
- What Changed:
- - Describe behavior changes, not file modifications
- - Focus on what users will see or experience differently
- - Avoid listing specific files, classes, or internal components
-
- User Impact:
- - Think from the merchant's perspective
- - What problem does this solve for them?
- - Do they need to take any action?
- - Will they notice anything different in the admin or frontend?
- - Consider performance, UX, and workflow impacts
-
- TONE: Clear, accessible, focus on user benefits
-
- - name: Post Feature Highlight Comment
- if: steps.highlight.outputs.structured_output
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- env:
- OUTPUT: ${{ steps.highlight.outputs.structured_output }}
- with:
- script: |
- const data = JSON.parse(process.env.OUTPUT);
- const marker = '<!-- feature-highlight-comment -->';
-
- const body = `${marker}
- ## ✨ Feature Highlight (Draft)
-
- **${data.title}**
-
- ### What Changed
- ${data.what_changed}
-
- ### User Impact
- ${data.user_impact}
-
- ---
- *🤖 Auto-generated. Please review and edit.*
-
- cc @woocommerce/developer-advocacy`;
-
- const { data: comments } = await github.rest.issues.listComments({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.issue.number,
- });
-
- const existing = comments.find(c => c.body.includes(marker));
-
- if (existing) {
- await github.rest.issues.updateComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- comment_id: existing.id,
- body: body,
- });
- } else {
- await github.rest.issues.createComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.issue.number,
- body: body,
- });
- }
-
- # ─────────────────────────────────────────────────────────────
- # JOB 2: Developer Advisory (for developers/extenders)
- # ─────────────────────────────────────────────────────────────
- developer-advisory:
- name: Generate Developer Advisory
- if: |
- github.event.pull_request.merged == true &&
- contains(github.event.pull_request.body, '[x] **Developer Advisory**')
- runs-on: ubuntu-latest
- timeout-minutes: 10
- permissions:
- contents: read
- pull-requests: write
- id-token: write
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
-
- - name: Add Developer Advisory label
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- with:
- script: |
- await github.rest.issues.addLabels({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.issue.number,
- labels: ['developer advisory']
- });
-
- - name: Generate Developer Advisory
- id: advisory
- uses: anthropics/claude-code-action@e90deca47693f9457b72f2b53c17d7c445a87342 # v1.0.171
- with:
- anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
- claude_args: >
- --allowedTools "Bash(gh pr diff:*),Bash(gh pr view:*)"
- --json-schema '{"type":"object","properties":{"title":{"type":"string"},"what_changed":{"type":"string"},"how_to_detect":{"type":"string"},"actions_needed":{"type":"string"}},"required":["title","what_changed","how_to_detect","actions_needed"]}'
- prompt: |
- Developer Advisory Generator for WooCommerce
-
- REPO: ${{ github.repository }}
- PR: #${{ github.event.pull_request.number }}
-
- OBJECTIVE
- Generate a developer advisory for changes that affect plugins, themes, or extensions.
-
- OUTPUT FORMAT (JSON)
- - title: Clear title describing the change (5-15 words)
- - what_changed: 2-3 sentences describing the technical changes (hooks, APIs, classes, etc.)
- - how_to_detect: 2-3 sentences explaining how developers can tell if their code is affected
- - actions_needed: 2-3 sentences describing what developers need to do to adapt
-
- METHOD
- 1. gh pr view ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --json title,body
- 2. gh pr diff ${{ github.event.pull_request.number }} --repo ${{ github.repository }}
-
- ANALYSIS GUIDELINES
-
- Title:
- - Keep to 1-3 sentences
- - Lead with the developer impact
- - Avoid internal implementation details (file names, test coverage, etc.)
- - Write as if for a developer changelog audience
- - Focus on "what's different now" not "what code changed"
-
- What Changed:
- - Describe behavior changes, not file modifications
- - Focus on third-party developers building extensions/plugins
- - Always mention new or changed hooks/filters with their exact names
- - Highlight API changes, new endpoints, or data structure changes
- - Call out breaking changes prominently
- - Note deprecations and migration paths
-
- How to Detect:
- - Help developers identify if their code is affected
- - Reference specific hook/filter names to search for
- - Mention affected APIs or class methods
-
- Actions Needed:
- - Provide clear migration steps
- - Identify new extension points they might want to use
- - Note any deprecation timelines
-
- FOCUS ON:
- - Hook changes (added, removed, signature changes)
- - Class/method changes (deprecations, removals, renames)
- - Filter/action changes
- - REST API changes
- - Database/option key changes
-
- TONE: Technical but clear, actionable
-
- - name: Post Developer Advisory Comment
- if: steps.advisory.outputs.structured_output
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- env:
- OUTPUT: ${{ steps.advisory.outputs.structured_output }}
- with:
- script: |
- const data = JSON.parse(process.env.OUTPUT);
- const marker = '<!-- developer-advisory-comment -->';
-
- const body = `${marker}
- ## ⚠️ Developer Advisory (Draft)
-
- **${data.title}**
-
- ### What Changed
- ${data.what_changed}
-
- ### How to Detect if You're Affected
- ${data.how_to_detect}
-
- ### Actions Needed
- ${data.actions_needed}
-
- ---
- *🤖 Auto-generated. Please review and edit.*
-
- cc @woocommerce/developer-advocacy`;
-
- const { data: comments } = await github.rest.issues.listComments({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.issue.number,
- });
-
- const existing = comments.find(c => c.body.includes(marker));
-
- if (existing) {
- await github.rest.issues.updateComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- comment_id: existing.id,
- body: body,
- });
- } else {
- await github.rest.issues.createComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.issue.number,
- body: body,
- });
- }