Skip to content

Commit

Permalink
Attempt to remove user info from current clone URL to fix HTTP basic …
Browse files Browse the repository at this point in the history
…auth
  • Loading branch information
JohnStarich committed Jun 3, 2024
1 parent 92b9362 commit ff587c3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions gopages/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"io"
"log"
"net/url"
"os"
"path/filepath"
"time"
Expand Down Expand Up @@ -146,8 +147,13 @@ var generateMemfsDocsPipe = pipe.New(pipe.Options{}).
})
return args, repo, errors.Wrap(err, "Failed to commit gopages files")
}).
Append(func(args memfsDocsArgs, repo *git.Repository) error {
pushOpts := &git.PushOptions{}
Append(func(args memfsDocsArgs, repo *git.Repository) (memfsDocsArgs, *git.Repository, *url.URL, error) {
remoteURL, err := url.Parse(args.Remote)
return args, repo, remoteURL, err
}).
Append(func(args memfsDocsArgs, repo *git.Repository, remoteURL *url.URL) error {
remoteURL.User = nil
pushOpts := &git.PushOptions{RemoteURL: remoteURL.String()}
pushOpts.Auth = getAuth(args.Flags)
err := repo.Push(pushOpts)
return errors.Wrap(err, "Failed to push gopages commit")
Expand Down

0 comments on commit ff587c3

Please sign in to comment.