Closed peterdietz closed 1 year ago
In order to achieve this, you can separate the gradle-build-action
step from the actual Gradle execution, like so:
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
gradle-version: ${{ env.GRADLE_VERSION }}
- name: Print Application Build Version
run: gradle printVersion >> $GITHUB_STEP_SUMMARY
In fact, I would recommend that you always use gradle-build-action
as a "Setup Gradle" step. This will likely become a more formal recommendation in the future.
Because of this simple workaround, I'm reluctant to add a new feature for this purpose.
That recommended use of gradle-build-action as a "setup step" makes so much more sense. I didn't think I actually had access to "real" gradle command, but thought I instead had to pipe everything thru arguments
to interact. Yes, now that I can just run
a command, there is no need for a one-off custom printing parameter. (Because then the next thing I'll ask for a custom one-off write to file parameter). And this setup-step and run
is universal. Thank you!
Other build pipelines allow me to output the text output of a command to the GitHub Step Summary, such that the build will display some additional information. And not just hidden inside of the logs of a step.
Would you consider adding a feature for this? Maybe add a parameter
write-to-step-summary: true
?In bash, I'll do something like:
But in gradle-build-action, I would like something like this:
As I integrate more of my jobs with Build/Publishing artifacts, its very helpful to sanity check which version of the app wrote an artifact. Thank you!