File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed
scripts/update-checks-doc Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,21 @@ This script does:
8
8
- update the outputs of the example inputs; the code blocks after ` Output: ` header
9
9
- update the links to the [ playground] ( https://rhysd.github.io/actionlint/ ) for the example inputs
10
10
11
- For making the implementation simple, this script does not support Windows. Please run this script
12
- on Linux or macOS.
11
+ For making the implementation simple, this script does not support Windows.
12
+
13
+ ## Prerequisites
14
+
15
+ - Go
16
+ - Linux or macOS
17
+ - ` shellcheck ` command
18
+ - ` pyflakes ` command
13
19
14
20
## Usage
15
21
22
+ ```
23
+ go run ./scripts/update-checks-doc [-check] FILE
24
+ ```
25
+
16
26
Update the document. This command directly modifies the file.
17
27
18
28
``` sh
Original file line number Diff line number Diff line change @@ -113,6 +113,9 @@ func Update(in []byte) ([]byte, error) {
113
113
}
114
114
if strings .HasPrefix (l , `<a id="` ) && strings .HasSuffix (l , `"></a>` ) {
115
115
anchor = strings .TrimSuffix (strings .TrimPrefix (l , `<a id="` ), `"></a>` )
116
+ if len (anchor ) == 0 {
117
+ return nil , fmt .Errorf ("id for <a> tag is empty at line %d" , lnum )
118
+ }
116
119
}
117
120
if l == "Example input:" {
118
121
log .Printf ("Found example input header for %q at line %d" , section , lnum )
Original file line number Diff line number Diff line change
1
+ <a id =" " ></a >
2
+ ## Hello
3
+
4
+ Example input:
5
+
6
+ ``` yaml
7
+ on : push
8
+ jobs :
9
+ test :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - run : echo ${{ unknown }}
13
+ ` ` `
14
+
15
+ Output:
16
+
17
+ ` ` `
18
+ This section will be generated
19
+ ```
20
+
21
+ [ Playground] ( https://rhysd.github.io/actionlint/#THIS_URL_WILL_BE_UPDATED )
22
+
23
+ The ` id ` attribute of the ` <a> ` is an empty string.
You can’t perform that action at this time.
0 commit comments