Commit d7cf1c8
authored
ci: avoid branch clash in regenerate-models workflow (#812)
## Summary
Fixes the branch-clash bug in
`.github/workflows/manual_regenerate_models.yaml` that was flagged as a
follow-up in #809. The recent manual run ([failing
CI](https://github.com/apify/apify-client-python/actions/runs/26239209577/job/77220728000))
failed at the `Commit model changes` step with:
```
fatal: refusing to fetch into branch 'refs/heads/update-models-manual' checked out at '...'
```
### Cause
The local `git switch -c "$BRANCH"` step pre-created the branch
unconditionally. `apify/actions/signed-commit@v1.0.0` with
`create-branch: 'true'` then ran `git fetch --depth=1 origin
"$BRANCH:refs/heads/$BRANCH"`, which refuses to fetch into a checked-out
branch.
### Fix
- When the remote branch already exists: fetch + check it out locally,
and tell signed-commit `create-branch: false`.
- When it doesn't exist: stay on the default branch and let
signed-commit create the remote branch with `create-branch: true`.
The `create_branch` decision is exported from the renamed `Set up
branch` step and consumed by the signed-commit step.1 parent f9018b9 commit d7cf1c8
1 file changed
Lines changed: 11 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
69 | 73 | | |
70 | 74 | | |
71 | | - | |
| 75 | + | |
72 | 76 | | |
| 77 | + | |
73 | 78 | | |
74 | | - | |
| 79 | + | |
75 | 80 | | |
76 | 81 | | |
77 | 82 | | |
| |||
112 | 117 | | |
113 | 118 | | |
114 | 119 | | |
115 | | - | |
| 120 | + | |
116 | 121 | | |
117 | 122 | | |
118 | 123 | | |
| |||
0 commit comments