Commit 608e809
authored
Fix: Resolve git checkout error in fetch-sfs-workflow (#55)
## Problem
The `fetch-sfs-workflow` was failing with this error:
```
error: Your local changes to the following files would be overwritten by checkout:
data/md-markers/...
Aborting
```
## Root Cause
The workflow was staging changes with `git add` **before** attempting to
checkout the target branch. When the branch existed remotely, `git
checkout` would fail because it would overwrite the staged changes.
## Solution
This PR fixes the issue by:
1. Checking for changes **without** staging them first (using `git diff
--quiet` and `git ls-files --others`)
2. Checking out the target branch **before** running `git add`
3. Staging files only after being on the correct branch
## Testing
The workflow should now successfully:
- Check for changes in `data/md-markers/` and `data/sfs_json/`
- Checkout existing `workflow-artifact-data` branch without conflicts
- Stage and commit changes on the correct branch
## Related
Fixes the error seen in:
https://github.com/se-lex/sfs-processor/actions/runs/20804696587/job/59756444556
🤖 Generated with [Claude Code](https://claude.com/claude-code)1 parent c9b5da1 commit 608e809
1 file changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
93 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
114 | 117 | | |
115 | 118 | | |
116 | 119 | | |
| |||
0 commit comments