How to Fix: Set default Timeout on Github action pipeline
Set default timeout limit on GitHub Action pipeline to auto-cancel after 30 minutes.
📋 Table of Contents
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)?
🛑 Set Default Timeout on Github Action Pipeline
- Yes, it is possible to set a default timeout limit on GitHub Actions pipelines.
🚀 How to Set Default Timeout
Method 1: Using the `timeout` environment variable
- Step 1: In your GitHub Actions workflow file, add an environment variable for timeout.
Example:
name: My Workflow
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run script
run: timeout 30m /bin/bash -c 'your script here'
✨ Wrapping Up
By setting a default timeout limit, you can prevent your pipelines from running indefinitely and reduce the risk of unexpected failures.
❓ Frequently Asked Questions
🛠️ Related Fixes
How to Fix: Pc crashes shortly after launching game (rainbow
Pc crashes shortly after launching game, possible cause: outdated grap
How to Fix: Installing an APK on a locked down phone
Installing an APK on a locked down phone: Try using a rooted device, e
How to Fix: FPS drops
FPS drops in games can be caused by high system resource usage, outdat