Commit 6c210f1
fix(workflows): improve Amber no-changes detection and reporting (#386)
## Summary
Fixes the Amber workflow error that occurred in run #19752601200 where
PR creation failed with "No commits between main and branch" error.
## Problem
When Claude Code ran but didn't make any commits (e.g., files already
properly formatted), the workflow would fail because it used `git diff
--quiet HEAD~1` which doesn't work correctly on a new branch with no
commits beyond the base.
## Changes
1. **Better change detection**: Now counts commits ahead of
`origin/main` using `git rev-list --count` instead of comparing to
`HEAD~1`
2. **User feedback**: When no changes are needed, posts an informative
comment to the issue explaining possible reasons
3. **Prevents failures**: Skips PR creation entirely when there are no
actual commits to push
## Testing
This will be tested when issue #384 is re-triggered after merge.
## Related Issues
- Fixes the error from workflow run:
https://github.com/ambient-code/platform/actions/runs/19752601200
- Related to issue #384
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>1 parent 8b55e1e commit 6c210f1
1 file changed
+37
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
| 225 | + | |
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
232 | 236 | | |
233 | | - | |
| 237 | + | |
234 | 238 | | |
235 | 239 | | |
236 | | - | |
237 | 240 | | |
238 | | - | |
| 241 | + | |
239 | 242 | | |
240 | | - | |
| 243 | + | |
| 244 | + | |
241 | 245 | | |
242 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
243 | 274 | | |
244 | 275 | | |
245 | 276 | | |
| |||
0 commit comments