Skip to content

Commit 982982e

Browse files
committed
try to source github username from environment variable if not specified
1 parent 4654467 commit 982982e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Written in Go, this is a cross-platform CLI utility that accepts the following r
3636
-github-repo string
3737
the GitHub repository to migrate to
3838
-github-user string
39-
specifies the GitHub user to use, who will author any migrated PRs (required)
39+
specifies the GitHub user to use, who will author any migrated PRs. can also be sourced from GITHUB_USER environment variable (required)
4040
-gitlab-domain string
4141
specifies the GitLab domain to use (default "gitlab.com")
4242
-gitlab-project string
@@ -53,7 +53,7 @@ Written in Go, this is a cross-platform CLI utility that accepts the following r
5353
rename master branch to main and update pull requests
5454
```
5555

56-
Use the `-github-user` argument to specify the GitHub username for whom the authentication token was issued (mandatory).
56+
Use the `-github-user` argument to specify the GitHub username for whom the authentication token was issued (mandatory). You can also specify this with the `GITHUB_USER` environment variable.
5757

5858
You can specify an individual GitLab project with the `-gitlab-project` argument, along with the target GitHub repository with the `-github-repo` argument.
5959

main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ func main() {
126126

127127
flag.Parse()
128128

129+
if githubUser == "" {
130+
githubUser = os.Getenv("GITHUB_USER")
131+
}
132+
129133
if githubUser == "" {
130134
logger.Error("must specify GitHub user")
131135
os.Exit(1)

0 commit comments

Comments
 (0)