Skip to content

Commit 97f8d75

Browse files
committed
ci: enable root access in CI pipeline
- Change `SUDO_ACCESS` environment variable from `false` to `true` - Add a step to switch to root user using `appleboy/[email protected]` with specified parameters and commands Signed-off-by: appleboy <[email protected]>
1 parent 9c32aa6 commit 97f8d75

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/ssh-server.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ jobs:
366366
--hostname=openssh-server \
367367
-p 2222:2222 \
368368
-e PUBLIC_KEY="${{ env.PUBLIC_KEY }}" \
369-
-e SUDO_ACCESS=false \
369+
-e SUDO_ACCESS=true \
370370
-e PASSWORD_ACCESS=true \
371371
-e USER_PASSWORD=password \
372372
-e USER_NAME=linuxserver.io \
@@ -459,3 +459,17 @@ jobs:
459459
echo "I am $INPUT_AAA, thanks"
460460
echo "$GITHUB_BASE_REF"
461461
echo "$GITHUB_REF"
462+
463+
- name: switch to root user
464+
uses: appleboy/[email protected]
465+
with:
466+
host: ${{ env.REMOTE_HOST }}
467+
username: linuxserver.io
468+
key: ${{ env.PRIVATE_KEY }}
469+
port: 2222
470+
script_stop: true
471+
request_pty: true
472+
command_timeout: 30s
473+
script: |
474+
whoami && echo 'hello world' && touch todo.txt
475+
sudo whoami

0 commit comments

Comments
 (0)