-
Notifications
You must be signed in to change notification settings - Fork 165
actions: run: Check script exists during recipe verification #302
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
base: main
Are you sure you want to change the base?
Conversation
a8a574e to
f4d49c5
Compare
|
fwiw this would be a great change to start adding test for |
27c3f44 to
fb2c1c0
Compare
fb2c1c0 to
8fd0ace
Compare
8c6a800 to
5fe7313
Compare
5fe7313 to
f805d84
Compare
f805d84 to
28eb2d9
Compare
28eb2d9 to
e7ebbf6
Compare
4e077b6 to
b943d29
Compare
actions/run_action.go
Outdated
| /* Extract the full script path from the arguments */ | ||
| args := strings.Split(run.Script, " ") | ||
| run.scriptPath = debos.CleanPathAt(args[0], context.RecipeDir) | ||
| run.scriptArgs = args[1:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather then doing this in the verifying function and passing it along in the action struct, why not split it out in a function you called in both places?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done i think; commits need cleaning up if you;re happy with logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, cleaned up the commits a bit. Hope it;s all good now.
Signed-off-by: Christopher Obbard <[email protected]>
b943d29 to
f926a36
Compare
If a script doesn't exist or the permissions are wrong, the recipe exits during the recipe execution. Let's do some early checks in the Verify stage to ensure the script exists on the host filesystem and a basic check that the file has executable permission bit set. This check also follows symlinks. Signed-off-by: Christopher Obbard <[email protected]>
Add a new test case to verify that run actions with scripts actually call a script which exists on the filesystem as well as some other interesting cases, like a script which doesn't exist, symlink scripts and missing files. Signed-off-by: Christopher Obbard <[email protected]>
2090858 to
ce1e5fc
Compare
If a script doesn't exist or the permissions are wrong, the
recipe exits during execution. Let's check early if the
script exists on the host filesystem and that the file has
executable permission bit set.