Published on

GitHub Actions Timeout: How to Auto Kill Rouge Workflow

Authors

Sometime there might be cases in which a rouge workflow keeps on running due to an issue like memory issue.

By default, Github Actions kills it after 6 hours (360 minutes).

And we can configure it at job level or even at the step level as well.

You can do that by adding timeout-minutes in your Github action workflow.

Let's say you've an workflow for running unit test cases

name: test
on:
  pull_request:
    branches: [master]
    paths:
      - 'src/**'
jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - name: Install Dependencies
        run: npm ci
        timeout-minutes: 10
      - name: Run all tests
        run: npm run test

Reference

Happy rouge-free workflows!