-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Execute custom scripts to be committed #5004
Comments
Currently not possible, and it would require even more steps if it's something that you require to be committed. I'll transfer this to the main repo as a feature request, but it could really benefit from a longer description of your use case. |
My use case: We have a self-hosted gitlab CI pipeline that tries to publish a maven artifact automatically on commit to master. All development happens on feature branches before being merged to master. Naturally the same artifact version can not be published twice (and we want to avoid relying on SNAPSHOTs for reproducability reasons), so it is the developer's responsibility to increase the version number in the build file when they make a pull request. We would like renovate to call a script that does this increasing of the build version number so that the renovate PR can be merged automatically and the pipeline can publish the changes. |
We have a similar “native” feature for npm called bumpVersion. Could this be adapted to support Maven too? |
The build system that we use is SBT, it just uses a maven repository. IIRC Maven is all dumb XML, so it shouldn't be too hard. SBT files on the other hand are more or less regular Scala code, so it's not as easy to update the version number in a general way since it could be hidden behind other functions and variables (the same is true for Gradle and a number of other build systems as well). Usually the version number is hard coded so we would just do a simple regex replace on the file. However that's kinda hacky and not something I'd be comfortable making official. A simple solution could be to add the option for a script that is executed on cloning a repository. This could be used to symlink other scripts in the repository into the .git/hooks folder and be able to change files in pre-/post-commit hooks, though that's not very user friendly. |
Which Renovate are you using? x the right box:
Renovate Open Source CLI
Which platform are you using? x the right box:
GitLab self-hosted
What is your Question?
Is it possible to execute a custom script in the repository before/after renovate commits the dependency updates? Use case is I want to update the project build version automatically as well, so that the CI pipeline can publish the artifact with a new version.
The text was updated successfully, but these errors were encountered: