-
Notifications
You must be signed in to change notification settings - Fork 157
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
-Prelease.overriddenBranchName=xxx is ignored #885
Comments
hi! enable it by:
With this setup, |
I dont see how it would help in my scenario. I tried to used axion-release-plugin does not have access to original branch name if it is running on main branch. That is why I want to use "workaround" for this is to use:
With that |
Maybe to make it even more clear. Here is our setup:
If I create PR where I want to merge branch |
axion release plugin actually integrates with github, |
assiming: name: Service Release
on:
pull_request:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
outputs:
released-version: ${{ steps.release.outputs.released-version }} # optional if you want to log it or smth
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '23'
distribution: 'temurin'
- uses: gradle/actions/setup-gradle@v4
- run: ./gradlew build
- run: ./gradlew release
id: release
- run: ./gradlew publish name: Library Release
on:
release:
types: [ created ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '23'
distribution: 'temurin'
- uses: gradle/actions/setup-gradle@v4
- run: ./gradlew publish would work out-of-the-box |
It does not work like that. I used your workflow and it is not bumping version as I would expect. So I created this PR: ![]() With setting like this: ![]() And result bumped patch version anyway.... I am expecting version ![]() I created testing repo where you can inspect it: https://github.com/ddeath/test-axion-release |
okay, it's probably a problem with the BTW. It looks like application workflow not a library one, if you still want to stick with semver there I would recommend moving to github releases, so you can have release notes (for people but also for dependabot), automated labels and breaking change detection - instead of branchname requirements. |
I think it is just no supported. Because again when merge happens on main branch then branch name will be resolved to main. Afaik there is no information about source branch name in github context. As for github releases, do you have something specific in mind? We are releasing automatically on each merge to main branch and we have monorepo where we have multiple applications there. |
ah, right - I'm trying to wrap my head around your workflow ;) For My recommendation: Assuming a repository that consists of dirs:
In your repository, you should have multiple tags: app1-v1.0.0 If you want to release
I'm writing this on the fly, sorry if it's too chaotic - I hope you get the idea. |
Yeah and that comes back to the original issue. Because we are on main branch we would like to use as a workaround:
That works but imho |
And just to complete the picture. Our workflow is:
So after PR is merged, there is no human intervention and it gets deployed. |
I'm glad you found a workaround. |
I am fine with creating PR for it if you want to have such change. If you do, I see two possible aproaches:
Let me know if you want it. I am kind of ok-ish to live with the workaround but I would rather not have it 😄 |
To answer that i would need to dig into git blame/history to see what was the point of this state check. |
Sure. But kind of does not matter what the original reason was. There will be always people who use it on main branch and they did not noticed that it is doing nothing 😄 so if we "fix" it, it wont be fix for them 😄 |
True, I just want to do everything I can to understand the decision to add HEAD check there :P |
When publishing with
./gradlew publish -Prelease.overriddenBranchName="breaking/asd"
overriddenBranchName
parameter is ignored. This is happening in github when we want to publish from main branch.This is because of this line:
axion-release-plugin/src/main/java/pl/allegro/tech/build/axion/release/infrastructure/git/GitRepository.java
Line 390 in 48ba8e1
overriddenBranchName
is only considered if we are in detached state.We want to use it on main branch since we are releasing after merge. But that means that branch versioning does not work because it will always be
main
branch. So idea was to useoverriddenBranchName
but that does not work either...The text was updated successfully, but these errors were encountered: