Skip to content

Commit 475e8e7

Browse files
authored
chore(techdocs-rewrite-relative-links): roll forward again to cli/v3 (#1126)
This undoes the previous revert since the issue is limited to the trigger-argo-workflows action.
1 parent 7e81677 commit 475e8e7

File tree

3 files changed

+11
-23
lines changed

3 files changed

+11
-23
lines changed

actions/techdocs-rewrite-relative-links/go.mod

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ require (
1111
github.com/spf13/afero v1.14.0
1212
github.com/stretchr/testify v1.10.0
1313
github.com/teekennedy/goldmark-markdown v0.5.1
14-
github.com/urfave/cli/v2 v2.27.7
1514
github.com/urfave/cli/v3 v3.3.8
1615
github.com/willabides/actionslog v0.5.1
1716
github.com/yuin/goldmark v1.7.12
@@ -20,16 +19,13 @@ require (
2019
)
2120

2221
require (
23-
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
2422
github.com/davecgh/go-spew v1.1.1 // indirect
2523
github.com/fatih/color v1.10.0 // indirect
2624
github.com/goccy/go-yaml v1.11.0 // indirect
2725
github.com/kr/pretty v0.1.0 // indirect
2826
github.com/mattn/go-colorable v0.1.8 // indirect
2927
github.com/mattn/go-isatty v0.0.12 // indirect
3028
github.com/pmezard/go-difflib v1.0.0 // indirect
31-
github.com/russross/blackfriday/v2 v2.1.0 // indirect
32-
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
3329
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect
3430
golang.org/x/sys v0.33.0 // indirect
3531
golang.org/x/text v0.23.0 // indirect

actions/techdocs-rewrite-relative-links/go.sum

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
github.com/aymanbagabas/go-udiff v0.3.1 h1:LV+qyBQ2pqe0u42ZsUEtPiCaUoqgA9gYRDs3vj1nolY=
22
github.com/aymanbagabas/go-udiff v0.3.1/go.mod h1:G0fsKmG+P6ylD0r6N/KgQD/nWzgfnl8ZBcNLgcbrw8E=
3-
github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo=
4-
github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
53
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
64
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
75
github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg=
@@ -35,21 +33,16 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
3533
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
3634
github.com/rhysd/go-fakeio v1.0.0 h1:+TjiKCOs32dONY7DaoVz/VPOdvRkPfBkEyUDIpM8FQY=
3735
github.com/rhysd/go-fakeio v1.0.0/go.mod h1:joYxF906trVwp2JLrE4jlN7A0z6wrz8O6o1UjarbFzE=
38-
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
39-
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
4036
github.com/spf13/afero v1.14.0 h1:9tH6MapGnn/j0eb0yIXiLjERO8RB6xIVZRDCX7PtqWA=
4137
github.com/spf13/afero v1.14.0/go.mod h1:acJQ8t0ohCGuMN3O+Pv0V0hgMxNYDlvdk+VTfyZmbYo=
4238
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
4339
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
4440
github.com/teekennedy/goldmark-markdown v0.5.1 h1:2lIlJ3AcIwaD1wFl4dflJSJFMhRTKEsEj+asVsu6M/0=
4541
github.com/teekennedy/goldmark-markdown v0.5.1/go.mod h1:so260mNSPELuRyynZY18719dRYlD+OSnAovqsyrOMOM=
46-
github.com/urfave/cli/v2 v2.27.7 h1:bH59vdhbjLv3LAvIu6gd0usJHgoTTPhCFib8qqOwXYU=
47-
github.com/urfave/cli/v2 v2.27.7/go.mod h1:CyNAG/xg+iAOg0N4MPGZqVmv2rCoP267496AOXUZjA4=
42+
github.com/urfave/cli/v3 v3.3.8 h1:BzolUExliMdet9NlJ/u4m5vHSotJ3PzEqSAZ1oPMa/E=
4843
github.com/urfave/cli/v3 v3.3.8/go.mod h1:FJSKtM/9AiiTOJL4fJ6TbMUkxBXn7GO9guZqoZtpYpo=
4944
github.com/willabides/actionslog v0.5.1 h1:dJ/Cxg8vO1pEohgC2O4CW1tCWFKJrYJXTZDWYJQK0+E=
5045
github.com/willabides/actionslog v0.5.1/go.mod h1:WDufDP3XZUMBOmau2BvfVCGYuUcVRZI6Eqy8ZRw4pJ8=
51-
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
52-
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
5346
github.com/yuin/goldmark v1.7.12 h1:YwGP/rrea2/CnCtUHgjuolG/PnMxdQtPMO5PvaE2/nY=
5447
github.com/yuin/goldmark v1.7.12/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg=
5548
go.abhg.dev/goldmark/toc v0.11.0 h1:IRixVy3/yVPKvFBc37EeBPi8XLTXrtH6BYaonSjkF8o=

actions/techdocs-rewrite-relative-links/main.go

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"github.com/lmittmann/tint"
1717
"github.com/spf13/afero"
1818
markdown "github.com/teekennedy/goldmark-markdown"
19-
"github.com/urfave/cli/v2"
19+
"github.com/urfave/cli/v3"
2020
"github.com/willabides/actionslog"
2121
"github.com/willabides/actionslog/human"
2222
"github.com/yuin/goldmark"
@@ -29,7 +29,7 @@ import (
2929
)
3030

3131
func main() {
32-
app := cli.App{
32+
app := cli.Command{
3333
Name: "techdocs-rewrite-relative-links",
3434
Flags: []cli.Flag{
3535
&cli.StringFlag{
@@ -66,20 +66,19 @@ func main() {
6666
Value: false,
6767
},
6868
},
69-
Action: func(cliCtx *cli.Context) error {
70-
repoURL := cliCtx.String("repo-url")
71-
defaultBranch := cliCtx.String("default-branch")
72-
rootDir := cliCtx.String("root-dir")
69+
Action: func(ctx context.Context, cmd *cli.Command) error {
70+
repoURL := cmd.String("repo-url")
71+
defaultBranch := cmd.String("default-branch")
72+
rootDir := cmd.String("root-dir")
7373

7474
level := slog.LevelWarn
75-
if cliCtx.Bool("debug") {
75+
if cmd.Bool("debug") {
7676
level = slog.LevelDebug
7777
}
78-
if level == slog.LevelDebug && cliCtx.Bool("verbose") {
78+
if level == slog.LevelDebug && cmd.Bool("verbose") {
7979
level = slog.LevelInfo
8080
}
8181

82-
ctx := cliCtx.Context
8382
var logger *slog.Logger
8483
if os.Getenv("GITHUB_ACTIONS") == "true" {
8584
handler := &human.Handler{}
@@ -104,7 +103,7 @@ func main() {
104103
}
105104
ctrl := controller{
106105
filesys: afero.NewOsFs(),
107-
dryRun: cliCtx.Bool("dry-run"),
106+
dryRun: cmd.Bool("dry-run"),
108107
logger: logger,
109108
rootDirectory: rootDir,
110109
repoURL: repoURL,
@@ -114,7 +113,7 @@ func main() {
114113
},
115114
}
116115
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
117-
if err := app.RunContext(ctx, os.Args); err != nil {
116+
if err := app.Run(ctx, os.Args); err != nil {
118117
cancel()
119118
slog.Error(err.Error())
120119
os.Exit(1)

0 commit comments

Comments
 (0)