Skip to content
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

Feature request - env options #15

Closed
ZacSweers opened this issue Apr 11, 2020 · 5 comments
Closed

Feature request - env options #15

ZacSweers opened this issue Apr 11, 2020 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@ZacSweers
Copy link

We set some env options dynamically on our builds due to github not preserving them between steps, and in our case they're computed. It would be great if there was an option like run_init that accepted something arbitrary to run before the gradle command

@eskatos
Copy link
Member

eskatos commented May 10, 2020

Hi @ZacSweers,
Is that a common practice? Could you please share some pointers showing how this would be done from a workflow point of view?

@ZacSweers
Copy link
Author

I don't have a public example but there re some cases where we run commands with local env vars

FOO=bar ./gradlew build

@ZacSweers
Copy link
Author

A better example would be env vars that gradle or other plugins (like the android plugin seek)
https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_environment_variables

We may dynamically set the JDK in a conditional way that can't be statically defined in github actions' env argument alone, hence wanting a script to manage it.

@eskatos
Copy link
Member

eskatos commented Jun 15, 2020

Hi Zac,

I can see how this could be useful. Thanks for clarifying.
I don't have that immediate need so it may take a while before I implement that myself.
Happy to review a pull request though ;)

It is somewhat related to #18 and should be made consistent form the YAML point of view.

@eskatos eskatos added enhancement New feature or request help wanted Extra attention is needed labels Jun 15, 2020
@bigdaz bigdaz added this to the v2.1 milestone Dec 17, 2021
@bigdaz
Copy link
Member

bigdaz commented Dec 31, 2021

With gradle-build-action@v2.1 it is now possible to use the action to configure Gradle and use a standard run action for the actual Gradle invocation. This should allow you to benefit from the caching this action provides, but retain your existing step that invokes Gradle, including any scripted setup of the environment.

@bigdaz bigdaz closed this as completed Dec 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants