Skip to content

Commit

Permalink
docs(actions): fix docs for new action
Browse files Browse the repository at this point in the history
  • Loading branch information
nobe4 committed Oct 2, 2024
1 parent 07d156c commit 3d832a3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/gen-docs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func main() {

if info.IsDir() ||
filepath.Ext(path) != ".go" ||
strings.HasSuffix(path, "_test.go") ||
filepath.Base(path) == "actions.go" {
return nil
}
Expand Down Expand Up @@ -64,9 +65,9 @@ func format(content string) (string, error) {
}

header := strings.Trim(parts[0], "\n")
parts = strings.SplitN(header, "\n", 2)
parts = strings.SplitN(header, "\n\n", 2)

re := regexp.MustCompile(`Package (\w+) implements an \[actions.Runner\] that (.*)\.`)
re := regexp.MustCompile(`Package (\w+) implements an \[actions.Runner\] that (.*\n?.*)\.`)
matches := re.FindStringSubmatch(parts[0])

if len(matches) < 3 {
Expand All @@ -83,7 +84,7 @@ func format(content string) (string, error) {
outParts = append(outParts, tail)
}

return strings.Join(outParts, "\n"), nil
return strings.Join(outParts, "\n\n"), nil
}

func indent(s string) string {
Expand Down
1 change: 1 addition & 0 deletions internal/actions/done/done.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
Package done implements an [actions.Runner] that marks a notification as done.
It updates Meta.Done and marks the notification's thread as done on GitHub.
The notification will be hidden until the thread is updated.
Ref: https://docs.github.com/en/rest/activity/notifications?apiVersion=2022-11-28#mark-a-thread-as-done
Expand Down
1 change: 1 addition & 0 deletions internal/actions/hide/hide.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
Package hide implements an [actions.Runner] that hides a notification.
It hides the notifications completely.
*/
package hide
Expand Down
1 change: 1 addition & 0 deletions internal/actions/read/read.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
Package read implements an [actions.Runner] that marks a notification as read.
It updates Unread and marks the notification's thread as read on GitHub.
Ref: https://docs.github.com/en/rest/activity/notifications?apiVersion=2022-11-28#mark-a-thread-as-read
*/
Expand Down

0 comments on commit 3d832a3

Please sign in to comment.