Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ldez/ghactions
Create a Github Action in 5 seconds!
https://github.com/ldez/ghactions
github github-actions go golang
Last synced: 3 days 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 (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-24T11:08:19.000Z (5 months ago)
- Last Synced: 2024-10-03T13:42:46.844Z (about 1 month ago)
- Topics: github, github-actions, go, golang
- Language: Go
- Homepage:
- Size: 82 KB
- Stars: 16
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# GHActions
[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/ldez/ghactions.svg?label=release)](https://github.com/ldez/ghactions/releases)
[![Build Status](https://github.com/ldez/ghactions/workflows/Main/badge.svg?branch=master)](https://github.com/ldez/ghactions/actions)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/ldez/ghactions)](https://pkg.go.dev/github.com/ldez/ghactions)[![Sponsor](https://img.shields.io/badge/Sponsor%20me-%E2%9D%A4%EF%B8%8F-pink)](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 mainimport (
"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 = trueerr := 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