fix(usage-metrics): order of actions matters#3623
fix(usage-metrics): order of actions matters#3623mdelapenya merged 1 commit intotestcontainers:mainfrom
Conversation
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Summary by CodeRabbit
WalkthroughThe workflow refactors the usage metrics generation logic to preserve the generated CSV in a temporary file, defer the staged-diff check until after branch selection, and conditionally reset the working tree when checking out an existing branch. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What does this PR do?
Restructure the "Create or update Pull Request" step in the usage-metrics workflow to avoid a
git checkoutfailure when the PR branch already exists on the remote.Previously, the workflow staged the CSV changes on
mainwithgit addbefore attempting to switch to the existing PR branch, causing git to abort with "Your local changes would be overwritten by checkout". Now the workflow:git diff --quiet(unstaged) instead of staging first/tmpbefore any branch operationsgit checkout -- docs/usage-metrics.csvso the branch switch succeedsWhy is it important?
When the workflow is re-triggered within the same month (e.g. to fill in versions that failed due to rate limiting), the PR branch already exists. The previous ordering caused the workflow to fail outright — no commit, no push, no updated PR — defeating the purpose of re-running it.
Related issues