Closed mailaneel closed 1 month ago
👋 Hey @mailaneel! Thanks for opening this issue.
I think I could see value in adding another output that specifically refers to the parent commit instead of the merge commit for this use case.
So perhaps we have two outputs like so:
outputs.sha
= data.commit.sha
- keep this as the merge commit perhaps? (so no new changes)outputs.parent_sha
= data.commit.tree.sha
- Add this new output option which points to the parent commit instead of the merge commitLet me know your thoughts!
P.S. also let me know your thoughts if we should just outright switch
outputs.sha
from being the merge commit to the parent commit and if so, why.
Thanks! 🙇
parent_sha
makes sense, and it also helps with backwards compatibility
@mailaneel I'm working on a PR for this now. I'm opting to just use default_branch_tree_sha
as the name of the new Actions output because I'm honestly not sure if it will reflect the parent sha in all contexts so its probably best to just leave the name as exactly what it is.
Changes are in v9.5.0
🎉
Describe the Issue
outputs.sha
refers to merge commit when rolling back to default branch instead of its parent commithttps://github.com/github/branch-deploy/blob/91f77d0f24b03ff5f3d0fd24ce45498d1690d16b/src/functions/prechecks.js#L65
This is fixed here: https://github.com/github/branch-deploy/blob/91f77d0f24b03ff5f3d0fd24ce45498d1690d16b/src/functions/identical-commit-check.js#L55
How are we trying to use this? We create docker tag on parent commit rather than merge commit sha and when trying to rollback we cannot find the docker image because
outputs.sha
refers to merge commitAlso please suggest if there is alternative way to resolve this.
Action Configuration
No response
Relevant Actions Log Output
No response
Extra Information
No response