Skip to content

github-action/valid-timeout-minutes

Disallow invalid timeout-minutes.

  • 🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

📖 Rule Details

This rule reports when jobs or steps has invalid timeout-minutes.

yaml
jobs:
  unit-test:
    steps:
      - timeout-minutes: 20
correct
yaml
jobs:
  unit-test:
    timeout-minutes: 0
yaml
jobs:
  unit-test:
    timeout-minutes: -2
yaml
jobs:
  unit-test:
    timeout-minutes: 2.3
yaml
jobs:
  unit-test:
    steps:
      - timeout-minutes: 30
incorrect

🔧 Options

ts
type TimeoutMinutesRange = {
  min?: number
  max?: number
}

type ValidTimeoutMinutesOptions = [
  | number
  | TimeoutMinutesRange
  | {
      job?: number | TimeoutMinutesRange
      step?: number | TimeoutMinutesRange
    },
]

Default options is set to { min: 1, max: 360 }.

🚀 Version

This rule was introduced in eslint-plugin-github-action v0.0.16

🔍 Implementation