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/ssh-action@v1.0.3` with specified parameters and commands

Signed-off-by: appleboy <appleboy.tw@gmail.com>
pull/330/head
appleboy 7 months ago
parent 9c32aa61f8
commit 97f8d752b5
No known key found for this signature in database

@ -366,7 +366,7 @@ jobs:
--hostname=openssh-server \ --hostname=openssh-server \
-p 2222:2222 \ -p 2222:2222 \
-e PUBLIC_KEY="${{ env.PUBLIC_KEY }}" \ -e PUBLIC_KEY="${{ env.PUBLIC_KEY }}" \
-e SUDO_ACCESS=false \ -e SUDO_ACCESS=true \
-e PASSWORD_ACCESS=true \ -e PASSWORD_ACCESS=true \
-e USER_PASSWORD=password \ -e USER_PASSWORD=password \
-e USER_NAME=linuxserver.io \ -e USER_NAME=linuxserver.io \
@ -459,3 +459,17 @@ jobs:
echo "I am $INPUT_AAA, thanks" echo "I am $INPUT_AAA, thanks"
echo "$GITHUB_BASE_REF" echo "$GITHUB_BASE_REF"
echo "$GITHUB_REF" echo "$GITHUB_REF"
- name: switch to root user
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ env.REMOTE_HOST }}
username: linuxserver.io
key: ${{ env.PRIVATE_KEY }}
port: 2222
script_stop: true
request_pty: true
command_timeout: 30s
script: |
whoami && echo 'hello world' && touch todo.txt
sudo whoami

Loading…
Cancel
Save