Skip to content

hofstadter-io/cinful

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cinful

Golang library and CLI to detect if a program is running in a CI system.

Pronounced "sinful" by mashing together CI, info, and the 'ful' suffix.

Originally ported from watson/ci-info and other links

as a CLI

prints details if in CI, otherwise nothing

cinful

cinful list # show all

Binaries are available on the releases page.

as a pkg

package main

import (
	"fmt"

	"github.com/hofstadter-io/cinful"
)

func main() {
	vendor := cinful.Info()
	if vendor != nil {
		fmt.Println(vendor)
	}
}

where

type Vendor struct {
	Name     string `json:"name,omitempty"`
	Constant string `json:"constant,omitempty"`
	Env      any    `json:"env,omitempty"`
	PR       any    `json:"pr,omitempty"`
	Val      string `json:"val,omitempty"`
}

Env will be a string after checking, but due to vendor differences, is a string, list, or map prior.

releasing

git must be clean first

release: goreleaser --rm-dist -p 1

snapshot (test): goreleaser --rm-dist -p 1 --snapshot

About

Detect if your code is running in CI

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages