Skip to content

Run tar with sudo [fixes #133]#181

Closed
jwt27 wants to merge 1 commit intoactions:masterfrom
jwt27:sudo-tar
Closed

Run tar with sudo [fixes #133]#181
jwt27 wants to merge 1 commit intoactions:masterfrom
jwt27:sudo-tar

Conversation

@jwt27
Copy link
Copy Markdown

@jwt27 jwt27 commented Feb 9, 2020

This works for me. I don't see any downsides to using sudo here.

Try it out with uses: jwt27/cache@dist

@liamnichols
Copy link
Copy Markdown

Not sure if this is related to the original issue, but I tried your fork out since I was already hitting issues and I got the following:

Post job cleanup.
sudo /usr/bin/tar -cz -f /Users/runner/runners/2.164.0/work/_temp/727f0d62-646e-46f2-a73a-dea2fd1ceebe/cache.tgz -C /Users/runner/runners/2.164.0/work/global-ios/global-ios/vendor/bundle .
tar: could not chdir to '/Users/runner/runners/2.164.0/work/global-ios/global-ios/vendor/bundle'
[warning]Tar failed with error: The process 'sudo' failed with exit code 1

I think I was getting the tar: could not chdir to ... error before though so maybe this isn't related to using sudo? The strange thing is that I also have a vendor/mint dir that I'm able to cache without an issue

@joshmgross
Copy link
Copy Markdown
Contributor

👋 Hey @jwt27, thanks for your contribution!

Since we can't guarantee that a self-hosted runner is using a passwordless sudo, this would break the action for those users. The rust-specific issues in #133 have now been resolved, if you're using a different ecosystem then please file a new issue with your use-case.

@joshmgross joshmgross closed this May 15, 2020
@evandrocoan
Copy link
Copy Markdown

We could use an option to this action called use_sudo and if this option is provided on the checks.yml using this action, then it will use sudo. This way we do not break the action for self-hosted runners not using passwordless sudo.

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.

4 participants