ghatm

module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2024 License: MIT

README

ghatm

Set timeout-minutes to all GitHub Actions jobs. ghatm finds GitHub Actions workflows and add timeout-minutes to jobs which don't have the setting.

ghatm edits workflow files but keeps YAML comments, indents, empty lines, and so on.

Motivation

timeout-minutes should be set properly, but if you have a lot of workflows which don't set timeout-minutes it's so bothersome to fix all of them by hand. ghatm sets timeout-minutes automatically.

How to install

ghatm is a single binary written in Go. So you only need to put the executable binary into $PATH.

  1. Homebrew
brew install suzuki-shunsuke/ghatm/ghatm
  1. Scoop
scoop bucket add lintnet https://github.com/suzuki-shunsuke/scoop-bucket
scoop install ghatm
  1. aqua
aqua g -i suzuki-shunsuke/ghatm
  1. Download a prebuilt binary from GitHub Releases and install it into $PATH

  2. Go

go install github.com/suzuki-shunsuke/ghatm/cmd/ghatm@latest

How to use

Please run ghatm set at the repository root directory.

ghatm set

then ghatm checks GitHub Actions workflows ^\.github/workflows/.*\.ya?ml$ and sets timeout-minutes: 30 to jobs which don't have timeout-minutes. Jobs which have timeout-minutes aren't changed. You can specify the value of timeout-minutes with -t option.

ghatm set -t 60

You can specify workflow files by positional arguments.

ghatm set .github/workflows/test.yaml

Tips: Fix workflows by CI

Using ghatm in CI, you can fix workflows automatically. When workflow files are added or changed in a pull request, you can run ghatm and commit and push changes to a feature branch.

LICENSE

MIT

Directories

Path Synopsis
cmd
pkg
cli
log

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL