-
Notifications
You must be signed in to change notification settings - Fork 970
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
Support for starting job service on condition is met #822
Comments
That would be very helpful if you have a shared workflow. We could turn on/off services based on workflow inputs |
Couldn't agree more, we add steps to run |
leaving
This can be used to build a basic conditional, it is a workaround, a proper solution should be implemented. |
Yes this would be a cool feature, we have the same problem on a shared workflow |
Got here searching for the solution of our problem with shared workflows :) |
this would be very useful when reusing workflows, please consider implementing it |
I think the following is supported, since 3e19635 aka v2.299.0 or later jobs:
my_job:
services:
my_service:
image: ${{ (some expression) && 'image:tag' || '' }} It's very similar to an if, just not so nice to write. |
thanks a lot, I was trying something similar. not nice aesthetically but if it works it's great. |
That would be very helpful for my organization as well |
Almost 3 years passed |
In my example it works as designed. If
|
Workaround works perfectly for me |
Best GH can do is update the docs with this workaround. |
The workaround is not ideal as the image names specified in expressions will fall off from automated updates via Renovate. |
It is used to skip empty image name in services which is the only way to handle condition services in github action currently actions/runner#822
# TODO - periodically check if conditional services are supported; actions/runner#822 services: devnet: image: ${{ (inputs.use-devnet) && 'shardlabs/starknet-devnet-rs:b41e566a3f17aa0e51871f02d5165959e50ce358-amd-seed0' || '' }} image: ${{ (inputs.use-devnet) && 'shardlabs/starknet-devnet-rs:0.0.3-seed0' || '' }} ports: - 5050:5050
It is used to skip empty image name in services which is the only way to handle condition services in github action currently actions/runner#822
* fix: skip service container for empty image It is used to skip empty image name in services which is the only way to handle condition services in github action currently actions/runner#822 * test: add testdata for empty image in services * fix: add missing test call * fix: wring test call * fix: invalid without expression --------- Co-authored-by: ChristopherHX <[email protected]>
* fix: skip service container for empty image It is used to skip empty image name in services which is the only way to handle condition services in github action currently actions/runner#822 * test: add testdata for empty image in services * fix: add missing test call * fix: wring test call * fix: invalid without expression --------- Co-authored-by: ChristopherHX <[email protected]>
* fix: skip service container for empty image It is used to skip empty image name in services which is the only way to handle condition services in github action currently actions/runner#822 * test: add testdata for empty image in services * fix: add missing test call * fix: wring test call * fix: invalid without expression --------- Co-authored-by: ChristopherHX <[email protected]>
Describe the enhancement
Add support of
if:
property tojobs.<job-id>.services.<service-id>
to start services only in case a condition is met.Code Snippet
The text was updated successfully, but these errors were encountered: