Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: warn when reusable workflow is used as a step #454

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

IlyaGulya
Copy link
Contributor

Using reusable workflow as a step is not supported by Github Actions.
However, actionlint currently does not warn about this behavior.

Now it does 🙂

@rhysd
Copy link
Owner

rhysd commented Oct 6, 2024

I'm not sure what this feature tries to solve. Is it a common mistake to pass a workflow YAML file to uses? How did you confirm that it's common?

@IlyaGulya
Copy link
Contributor Author

IlyaGulya commented Oct 7, 2024

@rhysd I'm not sure how common that is, however, Github currently does not warn if someone does that.
It gives error only once specific step is being run. (https://github.com/IlyaGulya/gh-actions-playground/actions/runs/11211480780/job/31160454101#step:3:1)
I'm in a process of learning the github actions and this one issue I've ran into recently.
And since there's no warning neither from github actions, nor actionlint, it was pretty unpleasant 🙂
Thus, I think that this check at least would not be excess part of actionlint.

@IlyaGulya
Copy link
Contributor Author

@rhysd
Copy link
Owner

rhysd commented Oct 19, 2024

Okay, I'm not against this feature but I'd like to make false positives as minimal as possible.

One possible false positive is local actions under .github/workflows/ directory. When local actions are put in the directory, for example .github/workflows/actions/my-action, they are used like

- uses: ./.github/workflows/actions/my-action
  with:
    arg: ...

This check will report the valid action usage as invalid reusable workflow usage.

@IlyaGulya
Copy link
Contributor Author

IlyaGulya commented Oct 21, 2024

Sure, I will fix that and try to test as much cases as possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants