Skip to content

Skip PR creation when only lastUpdated metadata changes#297

Merged
rajbos merged 2 commits intomainfrom
copilot/update-pr-body-link
Feb 25, 2026
Merged

Skip PR creation when only lastUpdated metadata changes#297
rajbos merged 2 commits intomainfrom
copilot/update-pr-body-link

Conversation

Copy link
Contributor

Copilot AI commented Feb 25, 2026

The model sync workflow created PR #291 containing only a metadata date change (lastUpdated: "2026-02-20""2026-02-23"). This adds detection to skip PR creation for metadata-only updates and includes workflow run links for traceability.

Changes

Prompt refinement (.github/workflows/prompts/sync-models-prompt.md)

  • Instruct Copilot CLI to update lastUpdated only when models are added

Change detection (.github/workflows/check-models.yml)

  • Detect date-only changes using grep -E '^[+-][^+-]' to count actual diff lines
  • Skip PR creation when exactly 2 lines change and both contain "lastUpdated"
  • Add workflow run link to PR body: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

Detection Logic

DIFF_OUTPUT=$(git diff src/modelPricing.json)
CHANGED_LINES=$(echo "$DIFF_OUTPUT" | grep -E '^[+-][^+-]' | wc -l)

if [ "$CHANGED_LINES" -eq 2 ]; then
  if echo "$DIFF_OUTPUT" | grep -E '^[+-][^+-]' | grep -v '"lastUpdated"' | wc -l | grep -q '^0$'; then
    if git diff --quiet src/tokenEstimators.json; then
      echo "changed=false" >> $GITHUB_OUTPUT  # Skip PR
    fi
  fi
fi

Future runs will skip PRs for metadata-only changes while still creating PRs with workflow links when actual model updates occur.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/rajbos/github-copilot-token-usage/actions/workflows/check-models.yml
    • Triggering command: /usr/bin/gh gh run list --workflow=check-models.yml --limit 30 --json createdAt,number,conclusion,event,url (http block)
  • https://api.github.com/repos/rajbos/github-copilot-token-usage/actions/workflows/check-models.yml/runs
    • Triggering command: /usr/bin/curl curl -s -H Accept: application/vnd.github+json REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

- Add workflow run link to PR body
- Update prompt to only update date when models are added
- Add logic to detect date-only changes and skip PR creation
- Tested with multiple scenarios (date-only, real changes, combined)

Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Copilot AI changed the title [WIP] Add workflow link to PR body Skip PR creation when only lastUpdated metadata changes Feb 25, 2026
@rajbos rajbos marked this pull request as ready for review February 25, 2026 09:03
@rajbos rajbos enabled auto-merge February 25, 2026 09:04
@rajbos rajbos merged commit 6bb94d6 into main Feb 25, 2026
14 checks passed
@rajbos rajbos deleted the copilot/update-pr-body-link branch February 25, 2026 09:18
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.

2 participants