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

Actions in different directory than .github\workflows #325

Open
bvandevliet opened this issue Apr 25, 2024 Discussed in #207 · 6 comments
Open

Actions in different directory than .github\workflows #325

bvandevliet opened this issue Apr 25, 2024 Discussed in #207 · 6 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@bvandevliet
Copy link

Discussed in #207

Originally posted by MariuszMielcarski June 1, 2023
Hi
I have noticed that the plugin successfully found my workflows in .github\workflows directory - and that works great.
But I have some reusable actions defined in other directory, and it was not identified as GitHub actions by the plugin.
Can configure the plugin somehow to add additional directories to track? To have IntelliSense work for my custom actions too.

Wanted to make this an issue as it would also really help out for people like me that run a simple self-hosted Gitea instance, since these workflows are stored in .gitea/workflows. If only there is some setting for the extension that holds an array of workflow paths would be really awesome! Default value would then of course be [".github/workflows"] :)

@felipesu19 felipesu19 added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels May 31, 2024
@felipesu19
Copy link
Collaborator

That would be great! Right now this isn't planned, but if someone added it in a PR, I would review it.

@keattang
Copy link

keattang commented Jul 2, 2024

@felipesu19 are you able to point me in the direction for how and where I might implement this? It would be very useful for us as we are creating reusable workflows instead of actions in order to get the linting but are finding this is creating a lot of clutter when we look at our workflows in the UI

@felipesu19
Copy link
Collaborator

@felipesu19 are you able to point me in the direction for how and where I might implement this? It would be very useful for us as we are creating reusable workflows instead of actions in order to get the linting but are finding this is creating a lot of clutter when we look at our workflows in the UI

I am pretty sure the logic is based on this regex:

pattern: "**/.github/workflows/*.{yaml,yml}"
I think if you track down where documentSelector is used, you could inject a new regex or just modify the selector.

(Caveat: I have not looked at this in any depth, this is my initial "taking a look at it" impression)

@keattang
Copy link

keattang commented Jul 3, 2024

Thanks @felipesu19!

Looking into this further, it seems that the languageservice only knows how to lint workflows and not custom actions. Is this correct? Do you know of a way we can lint custom actions (i.e. action.yaml)?

@ramblingenzyme
Copy link

ramblingenzyme commented Jul 8, 2024

It'd be amazing if we could lint custom actions, both within the .github/actions path, but also when authoring actions. In a repo which publishes an action I wouldn't mind having to override an option to configure VSCode with a different glob.

Even if it was only the expressions parser, that would be super helpful, though I'd imagine that depends on the workflow parser to pull the expressions out in the first place.

@bfondevila
Copy link

@felipesu19 are you able to point me in the direction for how and where I might implement this? It would be very useful for us as we are creating reusable workflows instead of actions in order to get the linting but are finding this is creating a lot of clutter when we look at our workflows in the UI

I am pretty sure the logic is based on this regex:

pattern: "**/.github/workflows/*.{yaml,yml}"

I think if you track down where documentSelector is used, you could inject a new regex or just modify the selector.
(Caveat: I have not looked at this in any depth, this is my initial "taking a look at it" impression)

I believe most people will use the folders "workflows" and "actions", I've not seen anyone suggesting to use any other folder. It would be great to be able to allow users to customize it, but if we confirm that line of code is indeed the only place referencing this folder, I'd suggest to just update this pattern to include both folders:

pattern: "**/.github/{workflows,actions}/*.{yaml,yml}"

But I don't think it's the only place in the code that matters, because based on that glob pattern it wouldn't recognize any yaml file if it was placed in a subfolder of workflows. I can see in the IDE that I can create subfolders inside workflows to any depth and it's picked up correctly by the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
Status: Backlog 🗒
Development

No branches or pull requests

5 participants