GitHub Actions で timeout-minutes を指定して浪費防止

GitHub Actions Workflow で timeout-minutes を指定して浪費を防止する方法をご紹介します。

GitHub

背景 The job running on runner GitHub Actions n has exceeded the maximum execution time of 360 minutes.

GitHub Actions で最大6時間のタイムアウトが発生して、以下のようなエラーが発生してしまいました。

The job running on runner GitHub Actions 4 has exceeded the maximum execution time of 360 minutes.

解決方法 timeout-minutes を使う

jobs:
  your-job:
    runs-on: ubuntu-latest
    timeout-minutes: 30 # job 全体
    steps:
      - run: sleep 300
        timeout-minutes: 20 # step 個別

以上、GitHub Actions Workflow で timeout-minutes を指定して、無駄な minute quota の浪費を防止したい現場からお送りしました。

参考情報