1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-09-15 18:57:01 +00:00

Initial commit with support for GitHub actions

This commit is contained in:
Casey Lee 2019-01-12 20:45:25 -08:00
commit 957282b8bc
24 changed files with 2125 additions and 0 deletions

34
main.go Normal file
View file

@ -0,0 +1,34 @@
package main
import (
"context"
"os"
"os/signal"
"github.com/nektos/act/cmd"
)
var version string
func main() {
ctx := context.Background()
ctx, cancel := context.WithCancel(ctx)
// trap Ctrl+C and call cancel on the context
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
defer func() {
signal.Stop(c)
cancel()
}()
go func() {
select {
case <-c:
cancel()
case <-ctx.Done():
}
}()
// run the command
cmd.Execute(ctx, version)
}