-
-
Notifications
You must be signed in to change notification settings - Fork 51
feat: add support for SOURCE_BRANCH
#642
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
base: main
Are you sure you want to change the base?
Conversation
|
@all-contributors please add @cjlpowers for code |
|
I've put up a pull request to add @cjlpowers! 🎉 |
SOURCE_BRANCHSOURCE_BRANCH
| echo "::group::commit changes" | ||
|
|
||
| # Only commit if merge commit was not already created by git pull | ||
| if git log -1 --pretty=%B | grep -q "Merge"; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @cjlpowers sorry for my late comment.
Actually I see a small issue with this part. If I understand right it requires that Merge is part of the commit message.
Actually it is not always the case for merge commits.
Possibly there is a better way to find out if it is a merge commit.
| TEMPLATE_REMOTE_GIT_HASH=$(git ls-remote "${SOURCE_REPO}" HEAD | awk '{print $1}') | ||
| # Detect default branch of source repo if SOURCE_BRANCH is not set | ||
| if [[ -z "${SOURCE_BRANCH}" ]]; then | ||
| SOURCE_BRANCH=$(git ls-remote --symref "${SOURCE_REPO}" HEAD 2>/dev/null | awk -F'/' '/^ref:/ {print $NF}' | tr -d '\r\n') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately the tests are failing with message:
::info::prechecks passed
::info::Missing env variable 'UPSTREAM_BRANCH' setting to remote default main
::info::Detected default branch of source repo: main HEAD
fatal: Needed a single revision
Error: Process completed with exit code 128.
Description
Close #621
See #621 (comment)
Remark
For automation please see closing-issues-using-keywords