v3.0.0
⚠️ Breaking Changes
- Merge sub packages (circleci, drone, github-actions, codebuild) to cienv package
- Remove the generic package
- Change struct to pointer
- Change API signature
Platform.CI()
is renamed toPlatform.ID()
Features
- Add
Add
function to support custom platforms - Add
JobURL
to get a job URL
How to use
Get platform
platform := cienv.Get(nil)
Support custom platforms
cienv.Add
isn't goroutine safe.
cienv.Add(func(param *cienv.Param) cienv.Platform {
// Support custom platform 1
})
cienv.Add(func(param *cienv.Param) cienv.Platform {
// Support custom platform 2
})
Mock Getenv and Read
platform := cienv.Get(&cienv.Param{
Getenv: mockGetenv,
Read: mockRead,
})