Skip to content

Commit

Permalink
ci: enable root access in CI pipeline
Browse files Browse the repository at this point in the history
- 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]>
  • Loading branch information
appleboy committed Jun 5, 2024
1 parent 9c32aa6 commit 97f8d75
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/ssh-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ jobs:
--hostname=openssh-server \
-p 2222:2222 \
-e PUBLIC_KEY="${{ env.PUBLIC_KEY }}" \
-e SUDO_ACCESS=false \
-e SUDO_ACCESS=true \
-e PASSWORD_ACCESS=true \
-e USER_PASSWORD=password \
-e USER_NAME=linuxserver.io \
Expand Down Expand Up @@ -459,3 +459,17 @@ jobs:
echo "I am $INPUT_AAA, thanks"
echo "$GITHUB_BASE_REF"
echo "$GITHUB_REF"
- name: switch to root user
uses: appleboy/[email protected]
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

0 comments on commit 97f8d75

Please sign in to comment.