File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4040 NO_TICKET_LABEL : ${{ inputs.no-ticket-label }}
4141 with :
4242 script : |
43+ // Log what triggered this workflow run
44+ const eventName = context.eventName;
45+ const action = context.payload.action;
46+ core.info(`🔍 Workflow triggered - Event: ${eventName}, Action: ${action}`);
47+
4348 const prBody = context.payload.pull_request.body || '';
4449 const prTitle = context.payload.pull_request.title || '';
4550 const prNumber = context.payload.pull_request.number;
@@ -205,6 +210,18 @@ jobs:
205210 updatedBody = prBody ? `${prBody}\n\n${newJiraSection}` : newJiraSection;
206211 }
207212
213+ // Only update PR if content actually changed
214+ // Normalize whitespace for comparison to avoid false positives
215+ const normalizedUpdated = updatedBody.trim().replace(/\s+/g, ' ');
216+ const normalizedCurrent = prBody.trim().replace(/\s+/g, ' ');
217+
218+ if (normalizedUpdated === normalizedCurrent) {
219+ core.info('✓ Jira links section is already up to date, no PR update needed');
220+ return;
221+ }
222+
223+ core.info('📝 Jira links section has changes, updating PR description');
224+
208225 // Update PR description
209226 await github.rest.pulls.update({
210227 owner: context.repo.owner,
You can’t perform that action at this time.
0 commit comments