125

Normally, my pipelines take 15 minutes to execute.

Recently, for some strange reasons, some pipelines take between 45 minutes and 6 hours to fail.

Is it possible to set a default timeout limit on GitHub Action's pipeline (for example, auto cancel after 30 minutes)?

Pang
  • 9,564
  • 146
  • 81
  • 122
Kevin ABRIOUX
  • 16,507
  • 12
  • 93
  • 99

1 Answers1

226

You can change default time limit in two ways

Your scenario:

my-job:
 runs-on:         ubuntu-latest
 timeout-minutes: 30
Samira
  • 7,795
  • 3
  • 25
  • 25
  • 29
    If I have many repos and each repo has many actions, it will be very difficult to apply this setting manually on every action. Is there an org level setting, so that the Org Admin can set it and it will get applied for each action in each repo belonging to that org? That way, the Org Admin can control it for all the repos from a central location. – Ven Apr 22 '21 at 07:22
  • Is there a way to limit whole action? – Alamakanambra Oct 27 '21 at 20:14
  • 1
    You can default per workflow: https://github.community/t/cannot-set-default-timeout-minutes/118164 – Daniel Kaplan Dec 27 '21 at 18:19
  • 6
    @DanielKaplan I think you're mistaken. – lmat - Reinstate Monica Aug 20 '22 at 08:23
  • 1
    Even I have the same problem as @Ven I have many repos and want to change this setting at org level, rather than depending upon my devs to do that for their repos. As of now this is clogging my runners. – ankur512512 Jan 04 '23 at 05:22