-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Empty pr_branch
output variable
#476
Comments
@kdeldycke thanks for the report. Indeed I forgot to handle some 'edge-cases' (thanks for the hint within the description). The edge-case in your case is the following:
Your action log part: ::info::Missing env variable 'UPSTREAM_BRANCH' setting to remote default main
::info::current git hash: b4686574a1a328f001ca1410f65b6137f990763d
Check new changes
a5d4c1b6d368ba257[28](https://github.com/kdeldycke/awesome-billing/actions/runs/8113301740/job/22199139632#step:4:30)94b0e93ac16cd65a6f02e refs/heads/sync-awesome-template_d48d756
::warn::Git branch 'sync-awesome-template_d48d756' exists in the remote repository related code part src/sync_template.sh line 51 function check_branch_remote_existing() {
git ls-remote --exit-code --heads origin "${NEW_BRANCH}" || BRANCH_DOES_NOT_EXIST=true
if [[ "${BRANCH_DOES_NOT_EXIST}" != true ]]; then
warn "Git branch '${NEW_BRANCH}' exists in the remote repository"
# following line will be added with v1.8.1
# set_github_action_outputs
exit 0
fi
}
With |
Wow, thanks @AndreasAugustin for the incredibly fast investigation and fix! I can confirm v1.8.1 fix the issue and You can check the proof here: https://github.com/kdeldycke/awesome-billing/actions/runs/8122438292/job/22201872306#step:5:5 |
Is there an existing issue for this?
Describe the bug
It looks like the new
pr_branch
variable output (implemented by #472 / #473) is not set if there is already a PR previously created byactions-template-sync
.Expected Behavior
I expect the
pr_branch
variable to always be set to the active / unmerged PR that is tracked an maintained byactions-template-sync
.Current Behavior
I have a workflow that essentially looks like this:
The full workflow code is available at: https://github.com/kdeldycke/awesome-billing/blob/b4686574a1a328f001ca1410f65b6137f990763d/.github/workflows/docs.yaml#L16-L59
Its execution log is available at: https://github.com/kdeldycke/awesome-billing/actions/runs/8113301740/job/22199139632
On execution, you can find that the step printing the
pr_branch
variable returns nothing:This is probably an edge-case because there is already an unmerged (and conflicting) PR that was previously created by
actions-template-sync
:I expect here
actions-template-sync
should identify the already existingsync-awesome-template_d48d756
PR and branch, update it, and return its ID inpr_branch
variable.Note that the behavior is the same wether
is_pr_cleanup
parameter istrue
orfalse
.Steps To Reproduce
No response
Possible Solution
No response
Additional Information/Context
This was encounter while playing with 1.8.0 to implement a temporary workaround for #467.
Template sync version Version
1.8.0
The text was updated successfully, but these errors were encountered: