-
Notifications
You must be signed in to change notification settings - Fork 26
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
Fix action-validator to run for each file on pre-commit hook #36
Conversation
As PR #31, |
@mpalmer interesting - I have a feeling this is related to the cli being run with the all file names in a double quoted string. Let me try again with each of them as arguments. |
Yeah, I tried it a few different ways and it didn't work. Maybe I'm invoking the command incorrectly? ❯ action-validator
Usage: action-validator <path_to_action_yaml>
Arguments:
<path_to_action_yaml> Input file
#################
# This one worked
#################
❯ action-validator .github/workflows/continuous_deployment.yml
############################
# None from here down worked
############################
❯ action-validator .github/workflows/continuous_deployment.yml .github/workflows/continuous_integration.yml
Usage: action-validator <path_to_action_yaml>
Arguments:
<path_to_action_yaml> Input file
❯ action-validator ".github/workflows/continuous_deployment.yml" ".github/workflows/continuous_integration.yml"
Usage: action-validator <path_to_action_yaml>
Arguments:
<path_to_action_yaml> Input file
❯ action-validator ".github/workflows/continuous_deployment.yml .github/workflows/continuous_integration.yml"
File not found: .github/workflows/continuous_deployment.yml .github/workflows/continuous_integration.yml |
Something to consider - even if the |
Your example invocations work for me. I'm pretty sure you're using a pre-0.4.0 version of
How so? The
|
Super interesting!! I did not know about that expansion in bash! And you're definitely right - I installed it with npm the first time around, so maybe that's why. When I install it with npm and run it with ❯ action-validator --help
Usage: action-validator <path_to_action_yaml>
Arguments:
<path_to_action_yaml> Input file |
Aaaaaah... NPM is, shall we say, somewhat experimental. Perhaps @bcheidemann can step in and explain what might be going on there. |
Hey @award28, thanks for flagging this! Support for installation via NPM is relatively new and it is not currently 1:1 compatible with the native binaries. @mpalmer and I have discussed this and the plan is for To this end, the following changes are at the top of my todo list:
Unfortunately, I haven't had time to address them this week as I've been suuuper busy at work and my free time has been mostly consumed by another project with a pretty tight deadline 🫠 I can't 100% commit to timelines yet but I'm hoping to have a PR for 1. and 2. this week. Number 3. will require a bit of thought since I ideally want to address #27 in the same PR, but I will aim to address that sooner rather than later fwiw. |
Pardon me while I 🤦. 0.5.1 rolling out now. |
Hey @bcheidemann, thanks for all of this info! That's perfectly reasonable; even the fact that it works with npm at all is very cool/impressive. I'm currently working on #38 to implement a |
@award28 if you're interested in helping with the WASM support that would be great! Is there anything in particular you'd be interested in working on? I have a branch where I started working on no.2 above but no.1 and 3 are fair game :) Although, I have been thinking a bit about how to make supporting NPM more sustainable since the current implementation requires JS glue for any kind of system access (network, filesystem, etc), and for that reason I've raised this issue to discuss the potential of pivoting from |
@bcheidemann given you're on 2 and the approach for 3 is being reconsidered I can look into 1! Is there anything else to add with that work besides "multi-file input"? If not, I'll make an issue to track it and get started on it after the |
Excellent! Maybe stating the obvious, but my view is it should behave the same as the native binary does when provided a list of files. Otherwise I have nothing else to add :) |
Changes
bin/run-action-validator
is now an executable file.action-validator
only takes a single file as input. This will fix pre-commit runs when multiple files are passed to entry script.As an alternative, I'd be happy to raise a PR which let's
action-validator
accept multiple files as inputs. However, this would come with some questions: