feat: artifact push and pull actions
All checks were successful
default / test artifact actions (push) Successful in 26s

This commit is contained in:
Louis Seubert 2026-09-13 19:10:04 +02:00
commit ae8d20e174
Signed by: louis9902
GPG key ID: 4B9DB28F826553BD
15 changed files with 1319 additions and 0 deletions

38
main.go Normal file
View file

@ -0,0 +1,38 @@
package main
import (
"context"
"fmt"
"os"
"os/signal"
"code.geekeey.de/actions/artifacts/internal/pull"
"code.geekeey.de/actions/artifacts/internal/push"
"code.geekeey.de/actions/sdk"
)
func main() {
if len(os.Args) < 2 {
fmt.Fprintln(os.Stderr, "usage: artifacts <push|pull>")
os.Exit(1)
}
action := sdk.New()
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
defer cancel()
var err error
switch os.Args[1] {
case "push":
err = push.New(action).Run(ctx)
case "pull":
err = pull.New(action).Run(ctx)
default:
err = fmt.Errorf("unknown command %q", os.Args[1])
}
if err != nil {
action.Errorf("%s", err)
os.Exit(1)
}
}