2024-11-01 23:54:31 +01:00
|
|
|
package main
|
|
|
|
|
|
2025-09-30 21:33:53 +02:00
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
"os"
|
|
|
|
|
"os/signal"
|
|
|
|
|
|
|
|
|
|
"code.geekeey.de/actions/sdk"
|
|
|
|
|
)
|
|
|
|
|
|
2024-11-01 23:54:31 +01:00
|
|
|
func main() {
|
2025-09-30 21:33:53 +02:00
|
|
|
action := &SaveArtifactAction{Action: sdk.New()}
|
|
|
|
|
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
|
|
|
|
|
defer cancel()
|
|
|
|
|
if err := action.Run(ctx); err != nil {
|
|
|
|
|
action.Errorf("%s", err)
|
|
|
|
|
os.Exit(1)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SaveArtifactAction struct {
|
|
|
|
|
*sdk.Action
|
|
|
|
|
repository string
|
|
|
|
|
path string
|
|
|
|
|
reference string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (action *SaveArtifactAction) setup() error {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (action *SaveArtifactAction) Run(ctx context.Context) error {
|
|
|
|
|
if err := action.setup(); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
return nil
|
2024-11-01 23:54:31 +01:00
|
|
|
}
|