I merged a PR branch to main which triggered a release-please workflow run. The run failed with this ambiguous error:
Error: release-please failed: Error adding to tree [commit SHA]
I'm hoping by putting this string in the issue title, others may find the solution easily (set target-branch).
Expected behavior
I expected the workflow to succeed, or at least indicate some way to fix the failure in the case of an error. Perhaps this is just a documentation issue vs a real bug - it's not clear to me. Or I might be doing something fundamentally wrong.
Observed behavior
The workflow failed with an ambiguous error message.
Upon searching for this error, I found one issue with that error string. This lead me to believe that the Github Token permission was somehow incorrect, but that doesn't make much sense since we're running it via this action, with the correct permissions: block.
We eventually realized that the error probably had something to do with the actual git operations, leading us to try adding in target-branch which fixed the workflow.
We fixed the workflow by adding target-branch: ${{ github.ref_name }} to the release-please action parameter list.
The workflow failed under these conditions:
1) When a PR was merged from a feature branch to main
2) When a workflow_dispatch event was used to manually trigger the release-please action via Github UI, with the "Use workflow from:" branch set to a feature branch.
3) The same as (2), but "Use workflow from:" set to main.
TL;DR
I merged a PR branch to
main
which triggered arelease-please
workflow run. The run failed with this ambiguous error:I'm hoping by putting this string in the issue title, others may find the solution easily (set
target-branch
).Expected behavior
I expected the workflow to succeed, or at least indicate some way to fix the failure in the case of an error. Perhaps this is just a documentation issue vs a real bug - it's not clear to me. Or I might be doing something fundamentally wrong.
Observed behavior
The workflow failed with an ambiguous error message.
Upon searching for this error, I found one issue with that error string. This lead me to believe that the Github Token permission was somehow incorrect, but that doesn't make much sense since we're running it via this action, with the correct
permissions:
block.We eventually realized that the error probably had something to do with the actual git operations, leading us to try adding in
target-branch
which fixed the workflow.Action YAML
Log output
Additional information
We fixed the workflow by adding
target-branch: ${{ github.ref_name }}
to the release-please action parameter list.The workflow failed under these conditions: 1) When a PR was merged from a feature branch to
main
2) When aworkflow_dispatch
event was used to manually trigger therelease-please
action via Github UI, with the "Use workflow from:" branch set to a feature branch. 3) The same as (2), but "Use workflow from:" set tomain
.