https://github.com/sjkaliski/go-github-actions
GitHub Actions for Golang
https://github.com/sjkaliski/go-github-actions
actions github-actions golang workflow
Last synced: about 1 year ago
JSON representation
GitHub Actions for Golang
- Host: GitHub
- URL: https://github.com/sjkaliski/go-github-actions
- Owner: sjkaliski
- License: mit
- Created: 2019-01-03T03:10:05.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-06-28T02:11:35.000Z (almost 6 years ago)
- Last Synced: 2025-03-26T10:04:40.740Z (about 1 year ago)
- Topics: actions, github-actions, golang, workflow
- Language: Shell
- Homepage:
- Size: 17.6 KB
- Stars: 56
- Watchers: 3
- Forks: 7
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-github-actions
A collection of [GitHub Actions](https://github.com/features/actions) for use in [Golang](https://golang.org/) projects.
## Actions
Currently there is support for `gofmt` and `golint`. If triggered by a `pull_request`, any failure will be posted back to the PR as a comment.
### gofmt
Runs `gofmt` on files in the directory. Fails if any file is not properly formatted.
```hcl
workflow "Go" {
on = "pull_request"
resolves = ["gofmt"]
}
action "gofmt" {
uses = "sjkaliski/go-github-actions/fmt@v1.0.0"
needs = "previous-action"
secrets = ["GITHUB_TOKEN"]
env {
GO_WORKING_DIR = "./path/to/go/files"
GO_IGNORE_DIRS = "./vendor"
}
}
```
To learn more about `gofmt`, visit the [official docs](https://golang.org/cmd/gofmt/).
### golint
Runs `golint` on files in the directory. Fails if any file fails lint checks.
```hcl
workflow "Go" {
on = "pull_request"
resolves = ["golint"]
}
action "golint" {
uses = "sjkaliski/go-github-actions/lint@v1.0.0"
needs = "previous-action"
secrets = ["GITHUB_TOKEN"]
env {
GO_WORKING_DIR = "./path/to/go/files"
GO_LINT_PATHS = "./pkg/... ./cmd/..."
}
}
```
To learn more about `golint`, see the [golint repository](https://github.com/golang/lint/).