Skip to content

Commit ab3f54c

Browse files
committed
fix code generation scripts broken due to the URL changes of GitHub document resoruces
1 parent 29372f9 commit ab3f54c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

scripts/generate-availability/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import (
2121
"github.com/yuin/goldmark/text"
2222
)
2323

24+
const theURL = "https://raw.githubusercontent.com/github/docs/main/content/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs.md"
25+
2426
var dbg = log.New(io.Discard, "", log.LstdFlags)
2527
var reReplaceholder = regexp.MustCompile("{%[^%]+%}")
2628

@@ -284,5 +286,5 @@ func run(args []string, stdout, stderr, dbgout io.Writer, srcURL string) int {
284286
}
285287

286288
func main() {
287-
os.Exit(run(os.Args[1:], os.Stdout, os.Stderr, os.Stderr, "https://raw.githubusercontent.com/github/docs/main/content/actions/learn-github-actions/contexts.md"))
289+
os.Exit(run(os.Args[1:], os.Stdout, os.Stderr, os.Stderr, theURL))
288290
}

scripts/generate-webhook-events/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import (
1818
"github.com/yuin/goldmark/text"
1919
)
2020

21+
const theURL = "https://raw.githubusercontent.com/github/docs/main/content/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows.md"
22+
2123
var dbg = log.New(io.Discard, "", log.LstdFlags)
2224

2325
func getFirstLinkText(n ast.Node, src []byte) (string, bool) {
@@ -273,5 +275,5 @@ func run(args []string, stdout, stderr, dbgout io.Writer, srcURL string) int {
273275
}
274276

275277
func main() {
276-
os.Exit(run(os.Args[1:], os.Stdout, os.Stderr, os.Stderr, "https://raw.githubusercontent.com/github/docs/main/content/actions/using-workflows/events-that-trigger-workflows.md"))
278+
os.Exit(run(os.Args[1:], os.Stdout, os.Stderr, os.Stderr, theURL))
277279
}

0 commit comments

Comments
 (0)