actionlint icon indicating copy to clipboard operation
actionlint copied to clipboard

Feature request: check that local actions exist

Open AndreyNautilus opened this issue 2 years ago • 3 comments

It would be great if actionlint checks that actions used in workflows actually exist.

Let's assume a repository contains a local github action: /.github/actions/my-action/action.yaml. If a workflow that uses this action contains a typo, for example:

- uses: ./.github/actions/my-actoin  # "actoin" vs "action"

the workflow is (obviously) incorrect, but actionlint doesn't report any error (version 1.6.23). The workflow will of course fail when triggered, but if the workflow has a complicated trigger (issues or schedule) which is not triggered on PR, such typos are hard to spot. In case of local actions, this check should be simple, because actionlint works with cloned repo and all local actions should be cloned too.

Theoretically the same check can be applied to remote actions (for other repos), for example:

- uses: actions/checkuot@v3  # "checkuot" vs "checkout"

but repos that contain actions can be private and the access will require a github token, so it's a bit more complicated. For remote actions actionlint can also check the existence of the version - v3 in this case, but it will be more useful when an action is referenced by commit hash.

AndreyNautilus avatar Jan 26 '23 16:01 AndreyNautilus

This was once checked by actionlint, but removed later because local actions don't always exist in the repository. Some people fetch their actions in workflow.

Theoretically the same check can be applied to remote actions (for other repos)

This means actionlint needs network requests and it will make actionlint much slower. Currently actionlint does not make any network request by design.

rhysd avatar Jan 27 '23 01:01 rhysd

Thanks for explanation.

Some people fetch their actions in workflow.

Wow, I was not aware of such use-case.

AndreyNautilus avatar Jan 27 '23 10:01 AndreyNautilus

Could it be added back in as an opt-in feature for the people who don't fetch their actions in a workflow?

tbutler-qontigo avatar Mar 21 '23 14:03 tbutler-qontigo