Skip to content

[OPIK-5374] [GHA] fix: skip empty PRs in peter-evans/create-pull-request workflows#5995

Merged
JetoPistola merged 1 commit intomainfrom
danield/OPIK-5374-fix-empty-prs-in-create-pull-request-workflows
Apr 6, 2026
Merged

[OPIK-5374] [GHA] fix: skip empty PRs in peter-evans/create-pull-request workflows#5995
JetoPistola merged 1 commit intomainfrom
danield/OPIK-5374-fix-empty-prs-in-create-pull-request-workflows

Conversation

@JetoPistola
Copy link
Copy Markdown
Contributor

@JetoPistola JetoPistola commented Mar 31, 2026

Details

image

Two GitHub Actions workflows (span_cost_upload_daily.yml and sdks_generate_openapi_spec_and_fern_code.yml) used git commit --allow-empty and unconditionally ran peter-evans/create-pull-request, creating empty PRs (no diff) when upstream data hadn't changed. This adds a git diff --quiet guard — matching the pattern already used in sync_provider_models.yml — to skip commit and PR creation when there are no actual changes.

Change checklist

  • User facing
  • Documentation update

Issues

  • OPIK-5374

AI-WATERMARK

AI-WATERMARK: yes

  • If yes:
    • Tools: Claude Code
    • Model(s): Claude Opus 4.6
    • Scope: Full implementation
    • Human verification: Code review

Testing

  • Manual review of workflow YAML diffs
  • Verified sync_provider_models.yml (already guarded) was left unchanged
  • Verified both modified workflows now gate commit + PR steps on has_changes == 'true'
  • Verified downstream Slack notification in OpenAPI workflow already checks pr_url != ''

Documentation

N/A

@JetoPistola
Copy link
Copy Markdown
Contributor Author

JetoPistola commented Mar 31, 2026

Later

--cached (--staging)

Closing for now


Update:

  1. --cached: Compares the index (staged files) against HEAD, after git add
  2. HEAD: All changes, staged + unstaged

The git diff is enough, --quiet to avoid verbose diff, only care in logic for 0/1

@JetoPistola JetoPistola reopened this Apr 6, 2026
Comment thread .github/workflows/span_cost_upload_daily.yml Outdated
Comment thread .github/workflows/sdks_generate_openapi_spec_and_fern_code.yml Outdated
…est workflows

Add git diff guard to span_cost_upload_daily.yml and
sdks_generate_openapi_spec_and_fern_code.yml to prevent creating
empty PRs when upstream data hasn't changed. Removes --allow-empty
from git commit and gates commit + PR creation on has_changes check.

sync_provider_models.yml already had this guard and needed no changes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JetoPistola JetoPistola force-pushed the danield/OPIK-5374-fix-empty-prs-in-create-pull-request-workflows branch from 3f0f3a9 to 0b71aed Compare April 6, 2026 07:52
@JetoPistola JetoPistola marked this pull request as ready for review April 6, 2026 07:59
@JetoPistola JetoPistola requested review from a team as code owners April 6, 2026 07:59
Copy link
Copy Markdown
Contributor

@LifeXplorer LifeXplorer left a comment

Choose a reason for hiding this comment

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

Looks good!

@JetoPistola JetoPistola merged commit 2d4a937 into main Apr 6, 2026
10 checks passed
@JetoPistola JetoPistola deleted the danield/OPIK-5374-fix-empty-prs-in-create-pull-request-workflows branch April 6, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants