Skip to content

Commit

Permalink
fix: update code
Browse files Browse the repository at this point in the history
Signed-off-by: yihong0618 <[email protected]>
  • Loading branch information
yihong0618 committed Jan 21, 2025
1 parent af20931 commit 03d508d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions github.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"flag"
"fmt"
"io/ioutil"
"math/rand"
"os"
"path"
Expand Down Expand Up @@ -33,7 +32,6 @@ var (
)

var baseURL = "https://github.com/"
var myTitle = "# My GitHub Status\n"
var myCreatedTitle = "## The repos I created\n"
var myContributedTitle = "## The repos I contributed to\n"

Expand Down Expand Up @@ -241,7 +239,7 @@ func makePrRepos(issues []*github.Issue, client *github.Client) ([]myPrInfo, int
}
repoCache[repoKey] = repo
}
if *repo.Private == true {
if *repo.Private {
continue
}
if len(prMap[repoName]) == 0 {
Expand Down Expand Up @@ -449,7 +447,7 @@ func main() {
myPrString := makeContributedString(myPRs, totalPrCount)

readMeFile := path.Join(os.Getenv("GITHUB_WORKSPACE"), "README.md")
readMeContent, err := ioutil.ReadFile(readMeFile)
readMeContent, err := os.ReadFile(readMeFile)
if err != nil {
panic(err)
}
Expand All @@ -459,7 +457,7 @@ func main() {
newContentString = newContentString + myStaredString
}
newContent := []byte(re.ReplaceAllString(string(readMeContent), `$1`+"\n"+newContentString+`$3`))
err = ioutil.WriteFile(readMeFile, newContent, 0644)
err = os.WriteFile(readMeFile, newContent, 0644)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 03d508d

Please sign in to comment.