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
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)
}
}
- 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