Skip to content

Commit 8ca3c01

Browse files
committed
Add and use a non-root user
1 parent d83d938 commit 8ca3c01

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/test-installers.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,14 @@ jobs:
142142
with:
143143
node-version: 20
144144
cache: "npm"
145-
- name: Install dependencies (on Rocky linux)
145+
- name: Configure Rocky linux
146146
if: matrix.container.image == 'rockylinux:9'
147-
run: dnf install -y sudo gcc gcc-c++ make git nss dbus xorg-x11-server-Xvfb
147+
run: |
148+
# Install dependencies
149+
dnf install -y sudo gcc gcc-c++ make git nss dbus xorg-x11-server-Xvfb
150+
# Add a non-admin sudoer user
151+
adduser compass
152+
echo "compass ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
148153
149154
- name: Cache downloads
150155
uses: actions/cache@v4
@@ -189,4 +194,7 @@ jobs:
189194
# Exposing token to prevent update server from being rate limited
190195
GITHUB_TOKEN: ${{ github.token }}
191196
working-directory: packages/compass-smoke-tests
192-
run: npm start -- --package ${{ matrix.package }} --tests ${{ matrix.test }}
197+
# Switching to a non-root user if necessary
198+
run: |
199+
${{ matrix.container.image == 'rockylinux:9' && 'su compass' || '' }}
200+
npm start -- --package ${{ matrix.package }} --tests ${{ matrix.test }}

0 commit comments

Comments
 (0)