File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -91,12 +91,14 @@ jobs:
9191 # Add a non-admin sudoer user and switch to it
9292 adduser compass
9393 echo "compass ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
94- # Make sure the compass user has write access to the workspace
95- chown -R compass:compass $HOME
96- ls -la $HOME
94+ # Make sure the compass user has write access to the npm cache and the workspace
95+ NPM_CACHE_PATH=$(npm config get cache)
96+ chown -R compass:compass $NPM_CACHE_PATH $GITHUB_WORKSPACE
97+ # Link the npm cache controlled by the setup-node action into the compass user's cache directory
98+ sudo -u compass ln -s $NPM_CACHE_PATH $(npm config get cache)
9799 # Use a shell which switch to the non-root compass user first
98100 # Using --preserve-env and --preserve-env=PATH to propagate environment variables
99- shell : sudo --preserve-env=HOME --preserve-env= PATH --preserve-env -u compass bash -x -e {0}
101+ shell : sudo --preserve-env=PATH --preserve-env -u compass bash -x -e {0}
100102 container :
101103 image : rockylinux:9
102104 volumes :
You can’t perform that action at this time.
0 commit comments