Skip to content

Commit

Permalink
fix: update abcxyz/pkg cli version (#4)
Browse files Browse the repository at this point in the history
fix: #2
  • Loading branch information
sailorlqh authored Jul 26, 2023
1 parent 1c48c9a commit 2f2bfd8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
12 changes: 7 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
module github.com/drevell/hackathon
module github.com/google-github-actions/send-google-chat-webhook

go 1.20

require (
github.com/abcxyz/pkg v0.3.0
github.com/abcxyz/pkg v0.5.1-0.20230724202741-7ad5bd201d22
github.com/google/go-cmp v0.5.9
)

require (
github.com/kr/text v0.1.0 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
golang.org/x/sys v0.6.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/posener/complete/v2 v2.1.0 // indirect
github.com/posener/script v1.2.0 // indirect
golang.org/x/sys v0.10.0 // indirect
)
13 changes: 13 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
github.com/abcxyz/pkg v0.3.0 h1:xygbuwjJBmiC90ieYXQyRdHqG8HzNrwgDrqMxojOsGE=
github.com/abcxyz/pkg v0.3.0/go.mod h1:9x3KtJ6HorqpFPHd0AyS4g72SMsbmvbVoJOno4+mhbg=
github.com/abcxyz/pkg v0.5.1-0.20230724202741-7ad5bd201d22 h1:aBf0HqtLelO1MhAE5+4TOVU1GxyEJiv50Uv95AsMCS0=
github.com/abcxyz/pkg v0.5.1-0.20230724202741-7ad5bd201d22/go.mod h1:r0w4o6uRL1LVTB/uhjKDW+pD1yOZ9YReHQXYgzYcFXM=
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4=
github.com/goccy/go-json v0.10.1 h1:lEs5Ob+oOG/Ze199njvzHbhn6p9T+h64F5hRj69iTTo=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
Expand All @@ -9,6 +12,8 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/lestrrat-go/blackmagic v1.0.1 h1:lS5Zts+5HIC/8og6cGHb0uCcNCa3OUt1ygh3Qz2Fe80=
github.com/lestrrat-go/httpcc v1.0.1 h1:ydWCStUeJLkpYyjLDHihupbn2tYmZ7m22BGkcvZZrIE=
github.com/lestrrat-go/httprc v1.0.4 h1:bAZymwoZQb+Oq8MEbyipag7iSq6YIga8Wj6GOiJGdI8=
Expand All @@ -17,6 +22,12 @@ github.com/lestrrat-go/jwx/v2 v2.0.8 h1:jCFT8oc0hEDVjgUgsBy1F9cbjsjAVZSXNi7JaU9H
github.com/lestrrat-go/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNBEYU=
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/posener/complete/v2 v2.1.0 h1:IpAWxMyiJ6zDSoq+QmEBF0thpOramC0kYuEFBTcQeTI=
github.com/posener/complete/v2 v2.1.0/go.mod h1:AkzsSVGx4ysH/4OhZf57dr4yszGXgFmXsP/VNwlaW7U=
github.com/posener/script v1.2.0 h1:DrZz0qFT8lCLkYNi1PleLDANFnKxJ2VmlNPJbAkVLsE=
github.com/posener/script v1.2.0/go.mod h1:s4sVvRXtdc/1aK6otTSeW2BVXndO8MsoOVUwK74zcg4=
go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ=
go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ=
go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
Expand All @@ -25,6 +36,8 @@ golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 h1:DdoeryqhaXp1LtT/emMP1BRJPHHKFi5akj/nbx/zNTA=
google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc=
Expand Down
9 changes: 4 additions & 5 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,13 @@ Usage: {{ COMMAND }} [options]
}

func (c *WorkflowNotificationCommand) Flags() *cli.FlagSet {
set := cli.NewFlagSet()
set := c.NewFlagSet()

f := set.NewSection("Chat space options")
f := set.NewSection("COMMAND OPTIONS")

f.StringVar(&cli.StringVar{
Name: "webhook-url",
Example: "https://chat.googleapis.com/v1/spaces/<SPACE_ID>/messages?key=<KEY>&token=<TOKEN>",
Default: "",
Target: &c.flagWebhookUrl,
Usage: `Webhook URL from google chat`,
})
Expand All @@ -96,11 +95,11 @@ func (c *WorkflowNotificationCommand) Run(ctx context.Context, args []string) er
return fmt.Errorf("expected 0 arguments, got %q", args)
}

ghJsonStr := os.Getenv(githubContextEnv)
ghJsonStr := c.GetEnv(githubContextEnv)
if ghJsonStr == "" {
return fmt.Errorf("environment var %s not set", githubContextEnv)
}
jobJsonStr := os.Getenv(jobContextEnv)
jobJsonStr := c.GetEnv(jobContextEnv)
if jobJsonStr == "" {
return fmt.Errorf("environment var %s not set", jobContextEnv)
}
Expand Down

0 comments on commit 2f2bfd8

Please sign in to comment.