-
-
Notifications
You must be signed in to change notification settings - Fork 164
Add working-directory support #18
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
Conversation
src/run.ts
Outdated
@@ -55,11 +57,16 @@ async function runLint(lintPath: string): Promise<void> { | |||
throw new Error(`please, don't change out-format for golangci-lint: it can be broken in a future`) | |||
} | |||
|
|||
const workingDirectory = path.resolve(core.getInput(`working-directory`)) |
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.
will it work if user didn't specify working-directory
? maybe we should check that the input was set?
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.
It will work because getInput
returns ''
. This behaviour is tested in the actions/core
test suite so I don't expect it to change.
Resolving the empty string relative to the current working directory, returns the current working directory.
I can make this more explicit if you wish though.
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.
thank you, I would prefer more explicit logic or unit test on it. I'm not sure that this behavior of path.resolve
is guaranteed and will remain e.g. after updating path
library.
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.
I'm certain it will. Because:
If after processing all given path segments an absolute path has not yet been generated, the current working directory is used.
but sure, I'll make this explicit.
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!
Pushed an update to the action.yml as well, it was out of date with respect to the github token (though i can put that in another PR if you really want) and I added working-directory. |
thank you very much! |
Thank you! And while I appreciate the invitation, I'm probably a little too busy to be much use around here :P |
Fixes #15