Skip to content

Commit

Permalink
node16 reached the end of life
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Oct 18, 2024
1 parent 763f886 commit 213a455
Show file tree
Hide file tree
Showing 40 changed files with 315 additions and 1,906 deletions.
2 changes: 1 addition & 1 deletion action_metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func TestLocalActionsParsingSkipped(t *testing.T) {
{
what: "not a local action",
proj: &Project{"", nil},
spec: "actions/checkout@v3",
spec: "actions/checkout@v4",
},
{
what: "action does not exist (#25, #40)",
Expand Down
30 changes: 15 additions & 15 deletions docs/checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ jobs:
# ERROR: The step is not run yet at this point
- run: echo ${{ steps.cache.outputs.cache-hit }}
# actions/cache sets cache-hit output
- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache
with:
key: ${{ hashFiles('**/*.lock') }}
Expand Down Expand Up @@ -1755,7 +1755,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
keys: |
${{ hashFiles('**/*.lock') }}
Expand All @@ -1767,28 +1767,28 @@ jobs:
Output:

```
test.yaml:7:15: missing input "key" which is required by action "actions/cache@v3". all required inputs are "key", "path" [action]
test.yaml:7:15: missing input "key" which is required by action "actions/cache@v4". all required inputs are "key", "path" [action]
|
7 | - uses: actions/cache@v3
7 | - uses: actions/cache@v4
| ^~~~~~~~~~~~~~~~
test.yaml:9:11: input "keys" is not defined in action "actions/cache@v3". available inputs are "key", "path", "restore-keys", "upload-chunk-size" [action]
test.yaml:9:11: input "keys" is not defined in action "actions/cache@v4". available inputs are "key", "path", "restore-keys", "upload-chunk-size" [action]
|
9 | keys: |
| ^~~~~
```

[Playground](https://rhysd.github.io/actionlint#eJyFj0EKwjAQRfc9xV8I1UJbcJmVK+8xDYOpqUlwEkVq725apYgbV8PMe/Dne6cQkpiiOPtOVAFEljhP4Jqc1D4LqUsupnqgmS1IIgd5W0CNJCwKpGPvnbSatOHDbf/BwL2PRq0bYPmR9efXBdiMIwyJOfYDy7asqrZqBq9tucM0/TWXyF81UI5F0wbSlk4s67u5mMKFLL8A+h9EEw==)

actionlint checks inputs of many popular actions such as `actions/checkout@v3`. It checks
actionlint checks inputs of many popular actions such as `actions/checkout@v4`. It checks

- some input is required by the action but it is not set at `with:`
- input set at `with:` is not defined in the action (this commonly occurs by a typo)

this is done by checking `with:` section items with a small database collected at building `actionlint` binary. actionlint
can check popular actions without fetching any `action.yml` of the actions from the remote so that it can run efficiently.

Note that it only supports the case of specifying major versions like `actions/checkout@v3`. Fixing version of action like
`actions/checkout@v3.0.2` and using the HEAD of action like `actions/checkout@main` are not supported for now.
Note that it only supports the case of specifying major versions like `actions/checkout@v4`. Fixing version of action like
`actions/checkout@v4.0.1` and using the HEAD of action like `actions/checkout@main` are not supported for now.

So far, actionlint supports more than 100 popular actions The data set is embedded at [`popular_actions.go`](../popular_actions.go)
and were automatically collected by [a script][generate-popular-actions]. If you want more checks for other actions, please
Expand All @@ -1806,27 +1806,27 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
# ERROR: actions/checkout@v2 is using the outdated runner 'node12'
- uses: actions/checkout@v2
# ERROR: actions/checkout@v3 is using the outdated runner 'node16'
- uses: actions/checkout@v3
```

Output:

```
test.yaml:8:15: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue [action]
test.yaml:8:15: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue [action]
|
8 | - uses: actions/checkout@v2
8 | - uses: actions/checkout@v3
| ^~~~~~~~~~~~~~~~~~~
```

[Playground](https://rhysd.github.io/actionlint#eJwlyjkOwCAMRNGeU8wFUKSUVLkKICSyyEYZO+fPVv3ifZWE4ewhbFqYAmCN9hY4XRj1Gby4mMcjv/YRrQ3+FxDhbEzI1VYVTrW3uqvbcs03dIgdzQ==)

In addition to the checks for inputs of actions described in [the previous section](#check-popular-action-inputs), actionlint
reports an error when a popular action is 'outdated'. An action is outdated when the runner used by the action is no longer
supported by GitHub Actions runtime. For example, `node12` is no longer available so any actions can use `node12` runner.
supported by GitHub Actions runtime. For example, `node12` is no longer available so any actions can not use `node12` runner.

Note that this check doesn't report that the action version is up-to-date. For example, even if you use `actions/checkout@v3` and
newer version `actions/checkout@v4` is available, actionlint reports no error as long as `actions/checkout@v3` is not outdated.
Note that this check doesn't report that the action version is up-to-date. For example, even if you use `actions/checkout@v4` and
newer version `actions/checkout@v5` is available, actionlint reports no error as long as `actions/checkout@v4` is not outdated.
If you want to keep actions used by your workflows up-to-date, consider to use [Dependabot][dependabot-doc].

<a name="check-shell-names"></a>
Expand Down
2 changes: 1 addition & 1 deletion example_your_own_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func ExampleLinter_yourOwnRule() {
//
// testdata/examples/main.yaml:14:9: every step must have its name [step-name]
// |
// 14 | - uses: actions/checkout@v3
// 14 | - uses: actions/checkout@v4
// | ^~~~~
fmt.Println(len(errs), "lint errors found by actionlint")
// Output: 1 lint errors found by actionlint
Expand Down
Loading

0 comments on commit 213a455

Please sign in to comment.