Skip to content

Commit be162f0

Browse files
committed
use id attribute instead of deprecated name for <a>
1 parent 1c77711 commit be162f0

30 files changed

+77
-77
lines changed

docs/checks.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ List of checks:
4545
Note that actionlint focuses on catching mistakes in workflow files. If you want some general code style checks, please consider
4646
using a general YAML checker like [yamllint][].
4747

48-
<a name="check-unexpected-keys"></a>
48+
<a id="check-unexpected-keys"></a>
4949
## Unexpected keys
5050

5151
Example input:
@@ -88,7 +88,7 @@ actionlint can detect unexpected keys while parsing workflow syntax and report t
8888
Key names are basically case-sensitive (though some specific key names are case-insensitive). This check is useful to catch
8989
case-sensitivity mistakes.
9090
91-
<a name="check-missing-required-duplicate-keys"></a>
91+
<a id="check-missing-required-duplicate-keys"></a>
9292
## Missing required keys and key duplicates
9393
9494
Example input:
@@ -129,7 +129,7 @@ And duplicate keys are not allowed. In workflow syntax, comparing some keys is *
129129

130130
actionlint checks these missing required keys and duplicate keys while parsing, and reports an error.
131131

132-
<a name="check-empty-mapping"></a>
132+
<a id="check-empty-mapping"></a>
133133
## Unexpected empty mappings
134134

135135
Example input:
@@ -155,7 +155,7 @@ Some mappings and sequences should not be empty. For example, `steps:` must incl
155155
actionlint checks such mappings and sequences are not empty while parsing, and reports the empty mappings and sequences as an
156156
error.
157157

158-
<a name="check-mapping-values"></a>
158+
<a id="check-mapping-values"></a>
159159
## Unexpected mapping values
160160

161161
Example input:
@@ -201,7 +201,7 @@ Some mapping values are restricted to some constant strings. Several mapping val
201201
actionlint checks such constant strings are used properly while parsing and reports an error when an unexpected value is
202202
specified.
203203

204-
<a name="check-syntax-expression"></a>
204+
<a id="check-syntax-expression"></a>
205205
## Syntax check for expression `${{ }}`
206206

207207
Example input:
@@ -248,7 +248,7 @@ test.yaml:13:38: unexpected end of input while parsing object property dereferen
248248
actionlint lexes and parses expression in `${{ }}` following [the expression syntax document][expr-doc]. It can detect
249249
many syntax errors like invalid characters, missing parentheses, unexpected end of input, ...
250250

251-
<a name="check-type-check-expression"></a>
251+
<a id="check-type-check-expression"></a>
252252
## Type checks for expression syntax in `${{ }}`
253253

254254
actionlint checks types of expressions in `${{ }}` placeholders of templates. The following types are supported by the type
@@ -371,7 +371,7 @@ test.yaml:19:14: type of expression at "env" must be object but found type strin
371371

372372
In above example, environment variables mapping is expanded at `env:` section. actionlint checks type of the expanded value.
373373

374-
<a name="check-contexts-and-builtin-func"></a>
374+
<a id="check-contexts-and-builtin-func"></a>
375375
## Contexts and built-in functions
376376

377377
Example input:
@@ -445,7 +445,7 @@ string.
445445

446446
Note that context names and function names are case-insensitive. For example, `toJSON` and `toJson` are the same function.
447447

448-
<a name="check-contextual-step-object"></a>
448+
<a id="check-contextual-step-object"></a>
449449
## Contextual typing for `steps.<step_id>` objects
450450

451451
Example input:
@@ -599,7 +599,7 @@ test.yaml:15:23: property "some-value" is not defined in object type {some_value
599599
The 'My action with output' action defines one output `some_value`. The property is typed at `steps.my_action.outputs` object
600600
so that actionlint can check incorrect property accesses like a typo in the output name.
601601
602-
<a name="check-contextual-matrix-object"></a>
602+
<a id="check-contextual-matrix-object"></a>
603603
## Contextual typing for `matrix` object
604604
605605
Example input:
@@ -687,7 +687,7 @@ steps:
687687
- run: echo ${{ matrix.bar }}
688688
```
689689
690-
<a name="check-contextual-needs-object"></a>
690+
<a id="check-contextual-needs-object"></a>
691691
## Contextual typing for `needs` object
692692

693693
Example input:
@@ -756,7 +756,7 @@ Outputs from the jobs can be accessed only from jobs following them via [`needs`
756756

757757
actionlint defines a type of `needs` variable contextually by looking at each job's `outputs:` section and `needs:` section.
758758

759-
<a name="check-comparison-types"></a>
759+
<a id="check-comparison-types"></a>
760760
## Strict type checks for comparison operators
761761

762762
Example input:
@@ -812,7 +812,7 @@ There are some additional surprising behaviors, but actionlint allows them not t
812812
- `'0' == false` and `0 == false` are true due to the same reason as above
813813
- Objects and arrays are only considered equal when they are the same instance
814814

815-
<a name="check-shellcheck-integ"></a>
815+
<a id="check-shellcheck-integ"></a>
816816
## [shellcheck][] integration for `run:`
817817

818818
Example input:
@@ -918,7 +918,7 @@ On GitHub Actions:
918918
SHELLCHECK_OPTS: --exclude=SC2129
919919
```
920920

921-
<a name="check-pyflakes-integ"></a>
921+
<a id="check-pyflakes-integ"></a>
922922
## [pyflakes][] integration for `run:`
923923

924924
Example input:
@@ -987,7 +987,7 @@ Since both `${{ }}` expression syntax is invalid as Python, remaining `${{ }}` m
987987
actionlint replaces `${{ }}` with underscores. For example `print('${{ matrix.os }}')` is replaced with
988988
`print('________________')`.
989989

990-
<a name="untrusted-inputs"></a>
990+
<a id="untrusted-inputs"></a>
991991
## Script injection by potentially untrusted inputs
992992

993993
Example input:
@@ -1096,7 +1096,7 @@ Instead, you should store the JSON string in an environment variable:
10961096
At last, the popular action [actions/github-script][github-script] has the same issue in its `script` input. actionlint also
10971097
checks the input.
10981098

1099-
<a name="check-job-deps"></a>
1099+
<a id="check-job-deps"></a>
11001100
## Job dependencies validation
11011101

11021102
Example input:
@@ -1169,7 +1169,7 @@ test.yaml:8:3: job "bar" needs job "unknown" which does not exist in this workfl
11691169

11701170
[Playground](https://rhysd.github.io/actionlint/#eNqkjDsOAjEMRPucYrptyAXcwRFoEUUMRuEjexXb4vooS0VNNdLMvGdKWNN7eRg7FeBmNgNQkasTTtzGDof98by1I9XrhJJTI+urhXhsk4es/mWBOp8EuXTD0u9LAbiNX3PqU+2t/4k/AQAA//96DTh7)
11711171

1172-
<a name="check-matrix-values"></a>
1172+
<a id="check-matrix-values"></a>
11731173
## Matrix values
11741174

11751175
Example input:
@@ -1217,7 +1217,7 @@ combination of matrix values. actionlint checks
12171217
- values in `exclude:` appear in `matrix:` or `include:`
12181218
- duplicate variations of matrix values
12191219

1220-
<a name="check-webhook-events"></a>
1220+
<a id="check-webhook-events"></a>
12211221
## Webhook events validation
12221222

12231223
Example input:
@@ -1299,7 +1299,7 @@ actionlint validates the Webhook configurations:
12991299
The table of available Webhooks and their types are defined in [`all_webhooks.go`](../all_webhooks.go). It is generated
13001300
by [a script][generate-webhook-events] and kept to the latest by CI workflow triggered weekly.
13011301

1302-
<a name="check-workflow-dispatch-events"></a>
1302+
<a id="check-workflow-dispatch-events"></a>
13031303
## Workflow dispatch event validation
13041304

13051305
Example input:
@@ -1447,7 +1447,7 @@ inputs:
14471447
}
14481448
```
14491449

1450-
<a name="check-glob-pattern"></a>
1450+
<a id="check-glob-pattern"></a>
14511451
## Glob filter pattern syntax validation
14521452

14531453
Example input:
@@ -1504,7 +1504,7 @@ workflow. It checks:
15041504
Most common mistake I have ever seen here is a misunderstanding that regular expression is available for filtering.
15051505
This rule can catch the mistake so that users can notice their mistakes.
15061506

1507-
<a name="check-cron-syntax"></a>
1507+
<a id="check-cron-syntax"></a>
15081508
## CRON syntax check at `schedule:`
15091509

15101510
Example input:
@@ -1547,7 +1547,7 @@ actionlint checks the CRON syntax and frequency of running a job. [The official
15471547
15481548
When the job is run more frequently than once every 5 minutes, actionlint reports it as an error.
15491549
1550-
<a name="check-runner-labels"></a>
1550+
<a id="check-runner-labels"></a>
15511551
## Runner labels
15521552
15531553
Example input:
@@ -1638,7 +1638,7 @@ test.yaml:4:30: label "windows-latest" conflicts with label "ubuntu-latest" defi
16381638
In most cases, this is a misunderstanding that a matrix combination can be specified at `runs-on:` directly. It should use
16391639
`matrix:` and expand it with `${{ }}` at `runs-on:` to run the workflow on multiple runners.
16401640

1641-
<a name="check-action-format"></a>
1641+
<a id="check-action-format"></a>
16421642
## Action format in `uses:`
16431643

16441644
Example input:
@@ -1694,7 +1694,7 @@ Note that actionlint does not report any error when a directory for a local acti
16941694
a common case where the action is managed in a separate repository and the action directory is cloned at running the workflow.
16951695
(See [#25][issue-25] and [#40][issue-40] for more details).
16961696

1697-
<a name="check-local-action-inputs"></a>
1697+
<a id="check-local-action-inputs"></a>
16981698
## Local action inputs validation at `with:`
16991699

17001700
My action definition at `.github/actions/my-action/action.yaml`:
@@ -1757,7 +1757,7 @@ test.yaml:13:11: input "additions" is not defined in action "My action" defined
17571757
When a local action is run in `uses:` of `step:`, actionlint reads `action.yml` file in the local action directory and
17581758
validates inputs at `with:` in the workflow are correct. Missing required inputs and unexpected inputs can be detected.
17591759
1760-
<a name="check-popular-action-inputs"></a>
1760+
<a id="check-popular-action-inputs"></a>
17611761
## Popular action inputs validation at `with:`
17621762
17631763
Example input:
@@ -1808,7 +1808,7 @@ So far, actionlint supports more than 100 popular actions The data set is embedd
18081808
and were automatically collected by [a script][generate-popular-actions]. If you want more checks for other actions, please
18091809
make a request [as an issue][issue-form].
18101810

1811-
<a name="detect-outdated-popular-actions"></a>
1811+
<a id="detect-outdated-popular-actions"></a>
18121812
## Outdated popular actions detection at `uses:`
18131813

18141814
Example input:
@@ -1843,7 +1843,7 @@ Note that this check doesn't report that the action version is up-to-date. For e
18431843
newer version `actions/checkout@v5` is available, actionlint reports no error as long as `actions/checkout@v4` is not outdated.
18441844
If you want to keep actions used by your workflows up-to-date, consider to use [Dependabot][dependabot-doc].
18451845

1846-
<a name="check-shell-names"></a>
1846+
<a id="check-shell-names"></a>
18471847
## Shell name validation at `shell:`
18481848

18491849
Example input:
@@ -1907,7 +1907,7 @@ test.yaml:27:16: shell name "sh" is invalid on Windows. available names are "bas
19071907
Available shells for runners are defined in [the documentation][shell-doc]. actionlint checks shell names at `shell:`
19081908
configuration are properly using the available shells.
19091909

1910-
<a name="check-job-step-ids"></a>
1910+
<a id="check-job-step-ids"></a>
19111911
## Job ID and step ID uniqueness
19121912

19131913
Example input:
@@ -1950,7 +1950,7 @@ test.yaml:12:3: key "TEST" is duplicated in "jobs" section. previously defined a
19501950
Job IDs and step IDs in each jobs must be unique. IDs are compared in case-insensitive. actionlint checks all job IDs
19511951
and step IDs, and reports errors when some IDs duplicate.
19521952

1953-
<a name="check-hardcoded-credentials"></a>
1953+
<a id="check-hardcoded-credentials"></a>
19541954
## Hardcoded credentials
19551955

19561956
Example input:
@@ -1996,7 +1996,7 @@ test.yaml:17:21: "password" section in "redis" service should be specified via s
19961996
and the value should be expanded with `${{ }}` syntax at `password:`. actionlint checks hardcoded credentials, and reports
19971997
them as an error.
19981998

1999-
<a name="check-env-var-names"></a>
1999+
<a id="check-env-var-names"></a>
20002000
## Environment variable names
20012001

20022002
Example input:
@@ -2033,7 +2033,7 @@ cases they are mistakes, and they may cause some issues on using them in shell s
20332033

20342034
actionlint checks environment variable names are correct in `env:` configuration.
20352035

2036-
<a name="permissions"></a>
2036+
<a id="permissions"></a>
20372037
## Permissions
20382038

20392039
Example input:
@@ -2080,7 +2080,7 @@ Each permission scopes have its access levels. The default levels are described
20802080

20812081
actionlint checks permission scopes and access levels in a workflow are correct.
20822082

2083-
<a name="check-reusable-workflows"></a>
2083+
<a id="check-reusable-workflows"></a>
20842084
## Reusable workflows
20852085

20862086
[Reusable workflows][reusable-workflow-doc] is a feature to call a workflow from another workflow.
@@ -2513,7 +2513,7 @@ as `{version: string}`. In the downstream job, actionlint can report an error at
25132513

25142514
Note that this check only works with local reusable workflow (starting with `./`).
25152515

2516-
<a name="id-naming-convention"></a>
2516+
<a id="id-naming-convention"></a>
25172517
## ID naming convention
25182518

25192519
Example input:
@@ -2567,7 +2567,7 @@ test.yaml:17:3: invalid job ID "2d-game". job ID must start with a letter or _ a
25672567
IDs must start with a letter or `_` and contain only alphanumeric characters, `-` or `_`. actionlint checks the naming
25682568
convention, and reports invalid IDs as errors.
25692569

2570-
<a name="ctx-spfunc-availability"></a>
2570+
<a id="ctx-spfunc-availability"></a>
25712571
## Contexts and special functions availability
25722572

25732573
Example input:
@@ -2639,7 +2639,7 @@ keys.
26392639
actionlint checks if these contexts and special functions are used correctly. It reports an error when it finds that some context
26402640
or special function is not available in your workflow.
26412641

2642-
<a name="#check-deprecated-workflow-commands"></a>
2642+
<a id="#check-deprecated-workflow-commands"></a>
26432643
## Check deprecated workflow commands
26442644

26452645
Example input:
@@ -2680,7 +2680,7 @@ GitHub deprecated the following workflow commands.
26802680
actionlint detects these commands are used in `run:` and reports them as errors suggesting alternatives. See
26812681
[the official document][workflow-commands-doc] for the comprehensive list of workflow commands to know the usage.
26822682

2683-
<a name="if-cond-always-true"></a>
2683+
<a id="if-cond-always-true"></a>
26842684
## Conditions always evaluated to true at `if:`
26852685

26862686
Example input:
@@ -2763,7 +2763,7 @@ works as intended.
27632763
actionlint checks all `if:` conditions in workflow and reports error when some condition is always evaluated to true due to extra
27642764
characters around `${{ }}`.
27652765

2766-
<a name="action-metadata-syntax"></a>
2766+
<a id="action-metadata-syntax"></a>
27672767
## Action metadata syntax validation
27682768

27692769
Example action metadata:

docs/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Note: The following targets are not tested since GitHub Actions doesn't support
9696
- Windows i386, arm64
9797
- FreeBSD i386, x86_64
9898

99-
<a name="download-script"></a>
99+
<a id="download-script"></a>
100100
## Download script
101101

102102
To install `actionlint` executable with one command, [the download script](../scripts/download-actionlint.bash) is available.

docs/usage.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ processes.
4242
actionlint -shellcheck= -pyflakes=
4343
```
4444

45-
<a name="format"></a>
45+
<a id="format"></a>
4646
### Format error messages
4747

4848
`-format` option can flexibly format error messages with [Go template syntax][go-template].
@@ -189,7 +189,7 @@ Note that special characters escaped with backslash like `\n` in the format stri
189189
| `2` | The command failed due to invalid command line option |
190190
| `3` | The command failed due to some fatal error |
191191

192-
<a name="on-github-actions"></a>
192+
<a id="on-github-actions"></a>
193193
## Use actionlint on GitHub Actions
194194

195195
Preparing `actionlint` executable with the download script is recommended. See [the instruction](install.md#download-script) for
@@ -263,7 +263,7 @@ Paste your workflow content to the code editor at left pane. It automatically sh
263263
the workflow content in the code editor, the results will be updated on the fly. Clicking an error message in the results
264264
table moves a cursor to position of the error in the code editor.
265265

266-
<a name="docker"></a>
266+
<a id="docker"></a>
267267
## [Docker][docker] image
268268

269269
[Official Docker image][docker-image] is available. The image contains `actionlint` executable and all dependencies (shellcheck
@@ -304,7 +304,7 @@ docker run --rm -v /path/to/workflows:/workflows rhysd/actionlint:latest -color
304304
Go APIs are available. See [the Go API document](api.md) for more details.
305305

306306

307-
<a name="tools-integ"></a>
307+
<a id="tools-integ"></a>
308308
## Tools integration
309309

310310
### reviewdog
@@ -325,7 +325,7 @@ jobs:
325325
- uses: reviewdog/action-actionlint@v1
326326
```
327327

328-
<a name="problem-matchers"></a>
328+
<a id="problem-matchers"></a>
329329
### Problem Matchers
330330

331331
[Problem Matchers][problem-matchers] is a feature to extract GitHub Actions annotations from terminal outputs of linters.

scripts/update-checks-doc/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ func Update(in []byte) ([]byte, error) {
107107
skipOutput = false
108108
count = 0
109109
}
110-
if strings.HasPrefix(l, `<a name="`) && strings.HasSuffix(l, `"></a>`) {
111-
anchor = strings.TrimSuffix(strings.TrimPrefix(l, `<a name="`), `"></a>`)
110+
if strings.HasPrefix(l, `<a id="`) && strings.HasSuffix(l, `"></a>`) {
111+
anchor = strings.TrimSuffix(strings.TrimPrefix(l, `<a id="`), `"></a>`)
112112
}
113113
if l == "Example input:" {
114114
log.Printf("Found example input header for %q at line %d", section, lnum)

scripts/update-checks-doc/testdata/err/empty_input.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<a name="hello"></a>
1+
<a id="hello"></a>
22
## Hello
33

44
Example input:

0 commit comments

Comments
 (0)