question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for starting job service on condition is met

See original GitHub issue

Describe the enhancement Add support of if: property to jobs.<job-id>.services.<service-id> to start services only in case a condition is met.

Code Snippet

jobs:
  my_job:
    services:
      my_service:
        if: ${{ some expression }}
        ....

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:46
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

10reactions
tanguyantoinecommented, Sep 12, 2022

That would be very helpful if you have a shared workflow. We could turn on/off services based on workflow inputs

3reactions
ChristopherHXcommented, Apr 27, 2023

I think the following is supported, since https://github.com/actions/runner/commit/3e196355deb87ff9f4c0c0b4643f512e62257bf8 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Re: Need to add one condition to Scheduled Job
Navigate to the Scheduled Job list by typing "Scheduled Jobs" in the navigation bar. · Find the Scheduled Job that you want to...
Read more >
Options that apply to jobs and started tasks
The error tracking option is applied only to error conditions reported by job tracking ... when the conditions of the specified assistance policy...
Read more >
USAJOBS Help Center | Federal employees
Understanding this will help you know which jobs you're eligible for and prevent you from spending time on jobs for which you're not...
Read more >
FMLA Frequently Asked Questions
In order to be eligible to take leave under the FMLA, an employee must: work for a covered employer;; have worked 1,250 hours...
Read more >
Fact Sheet #28F: Reasons that Workers May Take Leave ...
Caring for a family member under the FMLA includes assistance with basic medical, hygienic, nutritional, safety, transportation needs, physical care, or ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found