Cannot set default.timeout-minutes

Looking at it seems like I should be able to define a default timeout-minutes that will be applied to each job, however, when I have:

  timeout-minutes: 15

In the workflow, it reports that the key was unexpected:

 Invalid workflow file

The workflow is not valid. .github/workflows/code.yml (Line: 14, Col: 3): Unexpected value 'timeout-minutes'

Should I be able to set that key there? If not, I think the documentation for defaults could use a little more clarification as to what keys are allowed.


It might be a syntax issue – could you try something like this?

    - name: Run test
      timeout-minutes: 10
      run: make unit-test

If that doesn’t work, could you share a copy of your workflow .yml file?

Thanks for the response! We are able to set the value at the job level, but this requires setting the timeout for every job we add.

The documentation for defaults says:

A map of default settings that will apply to all jobs in the workflow. You can also set default settings that are only available to a job. For more information, see jobs.<job_id>.defaults .

Which made me think I could set the timeout-minutes there and have it apply to each job, but this does not appear to be the case. Could you clarify which keys are able to be set in defaults?

Currently, only is supported .
I would encourage you to share your requirement for timeout-minutes in the Feedback form for GitHub Actions.

Aha, I see, thanks for clarifying. I was thinking that was simply expanded documentation for that default but I see that it is the only supported option. I think the documentation could be clearer to that point. I’ll fill out the feedback form.

Thank you!

1 Like

@jszwedko Today I tried

  timeout-minutes: 15

and ran into the same thing as you did. It would be nice if that worked.

According to @yanjingzhu it seems like only is supported which makes this feature very limited and very specific to certain use cases. :frowning: