repos / pgit

static site generator for git
git clone https://github.com/picosh/pgit.git

commit
9278700
parent
60bbeb8
author
Eric Bower
date
2023-08-10 16:46:52 +0000 UTC
fix: checkout entire git repo in gha
2 files changed,  +15, -9
M .github/workflows/static.yml
+2, -0
1@@ -8,6 +8,8 @@ jobs:
2     runs-on: ubuntu-latest
3     steps:
4       - uses: actions/checkout@v3
5+        # need entire history
6+        fetch-depth: 0
7       - uses: actions/setup-go@v4
8         with:
9           go-version: '1.20'
M main.go
+13, -9
 1@@ -759,6 +759,8 @@ func main() {
 2 	var assetFlag = flag.Bool("assets", false, "copy static assets to --out")
 3 	var cloneFlag = flag.String("clone-url", "", "git clone URL")
 4 	var descFlag = flag.String("desc", "", "description for repo")
 5+	var maxCommitsFlag = flag.Int("max-commits", 0, "maximum number of commits to generate")
 6+	var hideTreeLastCommitFlag = flag.Bool("hide-tree-last-commit", false, "dont calculate last commit for each file in the tree")
 7 
 8 	flag.Parse()
 9 
10@@ -787,15 +789,17 @@ func main() {
11 	}
12 
13 	config := &Config{
14-		Outdir:   out,
15-		RepoPath: repoPath,
16-		RepoName: label,
17-		Cache:    make(map[string]bool),
18-		Revs:     revs,
19-		Theme:    theme,
20-		Logger:   logger,
21-		CloneURL: template.URL(*cloneFlag),
22-		Desc:     *descFlag,
23+		Outdir:             out,
24+		RepoPath:           repoPath,
25+		RepoName:           label,
26+		Cache:              make(map[string]bool),
27+		Revs:               revs,
28+		Theme:              theme,
29+		Logger:             logger,
30+		CloneURL:           template.URL(*cloneFlag),
31+		Desc:               *descFlag,
32+		MaxCommits:         *maxCommitsFlag,
33+		HideTreeLastCommit: *hideTreeLastCommitFlag,
34 	}
35 	config.Logger.Infof("%+v", config)
36