Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

cache: add sudo as an option #946

Open
rockandska opened this issue Nov 25, 2021 · 5 comments
Open

cache: add sudo as an option #946

rockandska opened this issue Nov 25, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@rockandska
Copy link

Describe the enhancement
Many people would like to cache some "system" directory but are not able to since it is the runner user who make the tar.
Adding a sudo option who could be used later by actions/cache will solve the problem

Code Snippet
There are many demands about it :
actions/cache#181 (comment)
actions/cache#133 (comment)
actions/cache#155
actions/cache#324 (comment)
actions/cache#629

@rockandska rockandska added the enhancement New feature or request label Nov 25, 2021
EHfive added a commit to EHfive/flakes that referenced this issue Apr 13, 2022
This reverts commit 44c3879.

"actions/cache" doesn't support caching system path (yet?),
see actions/toolkit#946

[no ci]
@ssbarnea
Copy link

That is indeed a critical feature as downloading system packages can take a considerable amount of time.

Atry added a commit to Atry/hhvm that referenced this issue Oct 7, 2022
@maciejskorski
Copy link

maciejskorski commented Mar 25, 2023

Upvote. My usecase is a scenario of UML support in Sphinx, which requires sudo apt-get install plantuml in addition to pip install.

@kennytrytek-wf
Copy link

Workaround:
As the first step in a job that needs root permissions to untar a cached object, grant tar root ownership and execution.

steps:
  - name: root suid tar
    run: sudo chown root:wheel /bin/tar && sudo chmod u+s /bin/tar

@benliao1
Copy link

Thanks for the suggestions @kennytrytek-wf this worked for me!

@notmgsk
Copy link

notmgsk commented Sep 19, 2023

Workaround: As the first step in a job that needs root permissions to untar a cached object, grant tar root ownership and execution.

steps:
  - name: root suid tar
    run: sudo chown root:wheel /bin/tar && sudo chmod u+s /bin/tar

I got the error

 chown: invalid group: ‘root:wheel’

but this worked instead

    run: sudo chown root /bin/tar && sudo chmod u+s /bin/tar

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants