Skip to content

Commit

Permalink
feat: handle SIGTERM signal and abort run
Browse files Browse the repository at this point in the history
  • Loading branch information
KnisterPeter authored and github-actions committed May 24, 2022
1 parent 3986d0b commit 109040a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"os"
"os/signal"
"syscall"

"github.com/nektos/act/cmd"
)
Expand All @@ -16,7 +17,7 @@ func main() {

// trap Ctrl+C and call cancel on the context
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
defer func() {
signal.Stop(c)
cancel()
Expand Down

0 comments on commit 109040a

Please sign in to comment.