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

add option to skip dependency installation [#77 reopen] #98

Merged
merged 1 commit into from
Jan 4, 2022

Conversation

noymer
Copy link

@noymer noymer commented Nov 2, 2021

This is copy of #77 and modified according to #77 comments.
In some situations, apt-get can't be called without sudo, but sudo is not permitted to user.
So, skipping dependency installation is necessary in this situation.

src/index.js Outdated
if (core.getInput("install-dependencies") === "true") {
const optionalSudoPrefix = core.getInput("sudo") === "true" ? "sudo " : "";
await execShellCommand(optionalSudoPrefix + "apt-get update");
await execShellCommand(optionalSudoPrefix + "apt-get install -y openssh-client xz-utils");
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. What about macOS and Windows? If anybody wants to use this Action on their self-hosted runner, they might want to skip installing the dependencies there, too.

I would have expected the if(...install-dependencies...) to span even the line if (process.platform === "darwin") { above.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've got your point. I agree with you!
I will change codes and push.

@@ -32,7 +32,20 @@ describe('Tmate GitHub integration', () => {
const customConnectionString = "foobar"
execShellCommand.mockReturnValue(Promise.resolve(customConnectionString))
await run()
expect(execShellCommand).toHaveBeenNthCalledWith(1, "pacman -Sy --noconfirm tmate")
expect(execShellCommand).toHaveBeenNthCalledWith(1, "pacman -Sy --noconfirm tmate");
expect(core.info).toHaveBeenNthCalledWith(1, `Web shell: ${customConnectionString}`);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I am concerned about a little bit is that main-loop test is duplicated many times.
Main-loop implementation is not platform-specific, so it seems testing main-loop only once is sufficient.

Copy link
Collaborator

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. @mxschmitt?

Copy link
Owner

@mxschmitt mxschmitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dscho
Copy link
Collaborator

dscho commented Nov 4, 2021

Only remaining question is: do we want this new option documented in the README.md?

@dscho dscho force-pushed the skip_dependency_installation branch from 5647912 to f1b2ac7 Compare December 5, 2021 21:38
@dscho
Copy link
Collaborator

dscho commented Dec 5, 2021

Only remaining question is: do we want this new option documented in the README.md?

I got a bit tired of waiting, so I allowed myself to force-push a fix.

@noymer
Copy link
Author

noymer commented Dec 27, 2021

@dscho
Sorry I didn't notice the comment about documentation, and thank you for your commit which includes README update.
I have changed a README a little bit about sudo, because sudo is actually for installation only now.
If this commit is ok, I hope you will merge this pull request.
If you won't approve this fix, you can remove the commit.

README.md Outdated Show resolved Hide resolved
apt-get is not available on certain distributions so it's better to have
the option to leave it out so we can still have the ability to run this
action without having to be on ubuntu.

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho force-pushed the skip_dependency_installation branch from 6a028f1 to fa7a79e Compare January 4, 2022 11:36
@dscho dscho merged commit f309efd into mxschmitt:master Jan 4, 2022
@dscho
Copy link
Collaborator

dscho commented Jan 4, 2022

@noymer and here's the new version: https://github.com/mxschmitt/action-tmate/releases/tag/v3.9. Congratulations! 🎉

@noymer noymer deleted the skip_dependency_installation branch January 5, 2022 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants