https://github.com/ldez/ghactions
Create a Github Action in 5 seconds!
https://github.com/ldez/ghactions
github github-actions go golang
Last synced: 9 months ago
JSON representation
Create a Github Action in 5 seconds!
- Host: GitHub
- URL: https://github.com/ldez/ghactions
- Owner: ldez
- License: other
- Created: 2019-02-19T00:07:31.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2025-04-11T21:35:28.000Z (10 months ago)
- Last Synced: 2025-04-11T22:34:22.536Z (10 months ago)
- Topics: github, github-actions, go, golang
- Language: Go
- Homepage:
- Size: 90.8 KB
- Stars: 16
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# GHActions
[](https://github.com/ldez/ghactions/releases)
[](https://github.com/ldez/ghactions/actions)
[](https://pkg.go.dev/github.com/ldez/ghactions)
[](https://github.com/sponsors/ldez)
Create a GitHub Action in 5 seconds!
- Environment variables: https://pkg.go.dev/github.com/ldez/ghactions#pkg-constants
- Supported events: https://pkg.go.dev/github.com/ldez/ghactions/event#pkg-constants
## Examples
```go
package main
import (
"context"
"log"
"github.com/google/go-github/v49/github"
"github.com/ldez/ghactions"
"github.com/ldez/ghactions/event"
)
func main() {
ctx := context.Background()
action := ghactions.NewAction(ctx)
// action.SkipWhenNoHandler = true
// action.SkipWhenTypeUnknown = true
err := action.
OnPullRequest(func(client *github.Client, requestEvent *github.PullRequestEvent) error {
// TODO add your code.
return nil
}).
OnIssues(func(client *github.Client, issuesEvent *github.IssuesEvent) error {
// TODO add your code.
return nil
}).
Run()
if err != nil {
log.Fatal(err)
}
}
```
## References
- https://help.github.com/en/actions
- https://github.com/marketplace/actions
- https://github-actions.explore-tech.org
- https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables
- https://help.github.com/en/actions/reference/events-that-trigger-workflows