x3c3 / ghactions

Create a Github Action in 5 seconds!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GHActions

GitHub tag (latest SemVer) Build Status PkgGoDev

Sponsor

Create a GitHub Action in 5 seconds!

Examples

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

About

Create a Github Action in 5 seconds!

License:Other


Languages

Language:Go 98.7%Language:Makefile 1.3%