When implementing a GitHub Workflow for App Advisor, specifically using the command advisor upgrade-plan apply --push, the operation fails with an error indicating that the branch name exceeds GitHub's limit of 255 characters.
The advisor upgrade-plan apply --push command builds branch names by concatenating every upgraded transitive dependency into a single string. If a single step (such as an upgrade on spring-sensors) involves multiple transitive dependencies (e.g., 12 or more), the resulting concatenated string can exceed the 255-byte limit enforced by GitHub for branch names.
Workaround:
To bypass this limitation while a permanent fix is being developed, users can implement a shell script to generate a unique, shorter custom branch name instead of relying on the default auto-generated name.
Example:
BRANCH="advisor-upgrade-$(date +%Y%m%d-%H%M%S)"
git checkout -b "$BRANCH"
git add -A
git commit -m "chore: apply Application Advisor upgrade step"
git push "https://x-access-token:${{ secrets.GIT_TOKEN_FOR_PRS }}@github.com/${{ github.repository }}.git" "$BRANCH"
gh pr create \
--title "chore: apply Application Advisor upgrade step" \
--body "Automated upgrade PR opened by Application Advisor." \
--base main \
--head "$BRANCH"
Engineering is currently evaluating a transition toward a unique branch naming strategy, possibly utilizing a hash-based identifier. This would allow App Advisor to detect branches in subsequent runs without requiring extremely long concatenated names.