For printing workflow commands in GitHub Actions.
See Workflow commands for GitHub Actions.
The code herein is based on GitHub Actions Toolkit.
import qualified GitHub.Workflow.Command as GH import Control.Lens ((&), (?~))
An annotation is at minimum just a string.
example1 :: IO () example1 = GH.executeCommand $ GH.error "Something failed."
An annotation can also include a location.
someLocation :: GH.Location someLocation = GH.inFile "app.js" & GH.position ?~ ( GH.atLine 13 & GH.extent ?~ GH.ToLine 16 )
example2 :: IO () example2 = GH.executeCommand $ GH.warning "Something seems amiss here." & GH.location ?~ someLocation