fix(ci): Fix deploy workflow branch detection for manual triggers
The deploy workflow was failing when manually triggered via workflow_dispatch
because it only checked for github.event.workflow_run.head_branch, which is
empty for manual triggers.
Issue:
- Manual trigger: gh workflow run deploy.yml --ref refactor/abstraction-layer
- BRANCH_NAME was empty ("")
- git checkout "" failed: "empty string is not a valid pathspec"
- Deployment failed on all Pis
Fix:
- Use fallback operator: github.event.workflow_run.head_branch || github.ref_name
- workflow_run trigger: uses head_branch (branch that triggered the tests)
- workflow_dispatch trigger: uses ref_name (branch being run on)
Now works for both:
- Automatic deployment after tests complete
- Manual deployment via workflow_dispatch or gh CLI
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
dba7624be0
commit
a109ae83f9
1 changed files with 1 additions and 1 deletions
2
.github/workflows/deploy.yml
vendored
2
.github/workflows/deploy.yml
vendored
|
|
@ -67,7 +67,7 @@ jobs:
|
|||
PI_HOSTS: ${{ secrets.PI_HOSTS }}
|
||||
PI_REPO_PATH: ${{ secrets.PI_REPO_PATH }}
|
||||
PI_USER: ${{ secrets.PI_USER }}
|
||||
BRANCH_NAME: ${{ github.event.workflow_run.head_branch }}
|
||||
BRANCH_NAME: ${{ github.event.workflow_run.head_branch || github.ref_name }}
|
||||
run: |
|
||||
# Split comma-separated PI_HOSTS into array
|
||||
IFS=',' read -ra HOSTS <<< "$PI_HOSTS"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue