mirror of
https://gitea.com/actions/appleboy-ssh-action.git
synced 2024-11-25 19:49:36 +01:00
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>
This commit is contained in:
parent
9c32aa61f8
commit
97f8d752b5
1 changed files with 15 additions and 1 deletions
16
.github/workflows/ssh-server.yml
vendored
16
.github/workflows/ssh-server.yml
vendored
|
@ -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 \
|
||||
|
@ -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/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…
Reference in a new issue