-
Notifications
You must be signed in to change notification settings - Fork 138
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 builder-fetch.sh path #1221
Conversation
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.
somewhat naive question but could this script have been invoked after changing to the ./BUILDER_CHECKOUT__DIR/ here
run: ./__BUILDER_CHECKOUT_DIR__/.github/actions/generate-builder/generate-builder.sh |
(that way the script doesn't need to know the outer context)
Yeah, I thought about that. We could probably set the working dir. |
Signed-off-by: Ian Lewis <ianlewis@google.com>
I think it would be somewhat clearer, but feel free to push back: we know this one works |
I agree. I would like to keep the script context free if possible. |
what do you mean by outer context? I think we need to agree on the way all actions invoke scripts for consistency. Otherwise we'll start running into subtle problems: the folders to access the source code (PROJECT_CHECKOUT_DIR) won't be accessible the same way from different scripts, etc. Keeping the invocation from the default director simplifies the code in general, I think |
The outer context being the action YAML that's invoking it. OK thinking about it from that angle, I'd actually assume that scripts in internal actions should be running relative to that action, not the root of the slsa-github-generator repository |
I don't think we can assume that. Sometimes the internal Actions need to access the PROJECT_CHECKOUT_DIR. Having the working directory the top-level root means we can keep the access the same and can easily identify what's invoking: something in the project repo or the builder repo. If we remove this, I'm afraid we're going to start wondering what the working directory is, and make mistakes overwriting things we should not. We want to be sure we don't overwrite builder's code, for example. |
Right, Unfortunately a lot of actions need to do something outside of their own directory in the workspace. If there is any real consistency to be had, it's probably, as @laurentsimon is suggesting, always running scripts from the root of the workspace. |
I'd like to push back for the reasons in other comments :) |
This reverts commit c66aa7b.
it's moot to the argument at this point. but actions do support working-directory |
Last time I tried it was an invalid workflow, IIRC. I think it only works for the run command. I think that's what the document hints at with |
Signed-off-by: Ian Lewis ianlewis@google.com