Skip to content

Fix no-op CMWA build failure#17663

Merged
CamSoper merged 1 commit intomasterfrom
CamSoper/fix-cmwa-no-op-build
Feb 26, 2026
Merged

Fix no-op CMWA build failure#17663
CamSoper merged 1 commit intomasterfrom
CamSoper/fix-cmwa-no-op-build

Conversation

@CamSoper
Copy link
Copy Markdown
Contributor

The workflow failed when the docs for a given version were already up to date, because git commit exits 1 when there's nothing to commit. This was surfaced by a failure notification in #docs-ops.

Guards the commit and push with if git diff --cached --quiet, and gates the pull-request job on a has_changes output so it is skipped (not failed) when no changes were made.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Feb 24, 2026

Documentation Review

This PR modifies a GitHub Actions workflow file rather than documentation content, so standard style/content checks don't apply. I've reviewed the workflow logic instead.

Summary

The fix correctly addresses a no-op build failure. Here's a breakdown:

Logic check for git diff --cached --quiet:

  • Exits 0 (quiet/success) when staged area has no changes → skips commit/push, sets has_changes=false
  • Exits 1 when staged area has changes → commits, pushes, sets has_changes=true

Output propagation:

  • Step output has_changes → job output has_changespull-request job condition ✓
  • Both branches of the if set the output, avoiding an undefined output state ✓

Job condition:

if: needs.build-customer-managed-workflow-agent-cli-docs.outputs.has_changes == 'true'

This correctly skips (not fails) the pull-request job when there are no doc changes ✓

Result

No issues found. The fix is minimal, correct, and well-scoped to the reported problem.


If you'd like additional review or have questions, mention @claude in a comment.

@pulumi-bot
Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a workflow failure that occurred when documentation for a given version was already up to date. The git commit command exits with code 1 when there's nothing to commit, causing the workflow to fail. The fix adds conditional logic to detect when there are no changes and gracefully skip the commit, push, and pull request creation steps.

Changes:

  • Added conditional check using git diff --cached --quiet to detect when no changes are staged
  • Added has_changes output variable to communicate change status between jobs
  • Made the pull-request job conditional on the has_changes output to skip PR creation when no changes exist

@CamSoper CamSoper enabled auto-merge (squash) February 25, 2026 22:02
@CamSoper CamSoper disabled auto-merge February 25, 2026 22:03
@CamSoper CamSoper merged commit 9b9a22a into master Feb 26, 2026
17 checks passed
@CamSoper CamSoper deleted the CamSoper/fix-cmwa-no-op-build branch February 26, 2026 21:14
cnunciato pushed a commit that referenced this pull request Mar 4, 2026
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants