mirror of
https://gitea.com/actions/appleboy-ssh-action.git
synced 2024-11-25 11:39:36 +01:00
chore: update action configuration for greater flexibility (#240)
- Update base image version from `1.6.12` to `1.6.13` in Dockerfile - Add `envs_format` input with flexible configuration in action.yml - Add a line to README.md pointing to action.yml for more information fix https://github.com/appleboy/ssh-action/issues/213
This commit is contained in:
parent
6268c80dd6
commit
334f9259f2
4 changed files with 65 additions and 37 deletions
97
.github/workflows/ci.yml
vendored
97
.github/workflows/ci.yml
vendored
|
@ -7,8 +7,8 @@ env:
|
|||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
name: Build
|
||||
testing01:
|
||||
name: default flag testing
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout
|
||||
|
@ -78,40 +78,6 @@ jobs:
|
|||
mkdir abc/def
|
||||
ls -al
|
||||
|
||||
- name: pass environment
|
||||
uses: ./
|
||||
env:
|
||||
FOO: "BAR"
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
key: ${{ secrets.KEY }}
|
||||
port: ${{ secrets.PORT }}
|
||||
envs: FOO
|
||||
script: |
|
||||
echo "I am $FOO, thanks"
|
||||
echo "I am $BAR, thanks"
|
||||
|
||||
- name: pass multiple environment
|
||||
uses: ./
|
||||
env:
|
||||
FOO: "BAR"
|
||||
BAR: "FOO"
|
||||
SHA: ${{ github.sha }}
|
||||
PORT: ${{ secrets.PORT }}
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
key: ${{ secrets.KEY }}
|
||||
port: ${{ secrets.PORT }}
|
||||
envs: FOO,BAR,SHA,PORT
|
||||
script: |
|
||||
echo "I am $FOO, thanks"
|
||||
echo "I am $BAR, thanks"
|
||||
echo "sha: $SHA"
|
||||
echo "port: $PORT"
|
||||
sh test.sh
|
||||
|
||||
- name: ssh key passphrase
|
||||
uses: ./
|
||||
with:
|
||||
|
@ -172,3 +138,62 @@ jobs:
|
|||
# key: ${{ secrets.ID_ED25519 }}
|
||||
# port: ${{ secrets.TUNNEL_PORT }}
|
||||
# script: whoami
|
||||
|
||||
testing02:
|
||||
name: testing with envs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: pass environment
|
||||
uses: ./
|
||||
env:
|
||||
FOO: "BAR"
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
key: ${{ secrets.KEY }}
|
||||
port: ${{ secrets.PORT }}
|
||||
envs: FOO
|
||||
script: |
|
||||
echo "I am $FOO, thanks"
|
||||
echo "I am $BAR, thanks"
|
||||
|
||||
- name: pass multiple environment
|
||||
uses: ./
|
||||
env:
|
||||
FOO: "BAR"
|
||||
BAR: "FOO"
|
||||
SHA: ${{ github.sha }}
|
||||
PORT: ${{ secrets.PORT }}
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
key: ${{ secrets.KEY }}
|
||||
port: ${{ secrets.PORT }}
|
||||
envs: FOO,BAR,SHA,PORT
|
||||
script: |
|
||||
echo "I am $FOO, thanks"
|
||||
echo "I am $BAR, thanks"
|
||||
echo "sha: $SHA"
|
||||
echo "port: $PORT"
|
||||
sh test.sh
|
||||
|
||||
- name: custom envs format
|
||||
uses: ./
|
||||
env:
|
||||
FOO: "BAR"
|
||||
AAA: "BBB"
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
key: ${{ secrets.KEY }}
|
||||
port: ${{ secrets.PORT }}
|
||||
envs: FOO,BAR,AAA
|
||||
envs_format: export TEST_{NAME}={VALUE}
|
||||
script: |
|
||||
echo "I am $TEST_FOO, thanks"
|
||||
echo "I am $TEST_BAR, thanks"
|
||||
echo "I am $BAR, thanks"
|
||||
echo "I am $TEST_AAA, thanks"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM ghcr.io/appleboy/drone-ssh:1.6.12
|
||||
FROM ghcr.io/appleboy/drone-ssh:1.6.13
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
|
|
@ -33,6 +33,7 @@ See [action.yml](./action.yml) for more detailed information.
|
|||
* `debug` - enable debug mode
|
||||
* `use_insecure_cipher` - include more ciphers with use_insecure_cipher (see [#56](https://github.com/appleboy/ssh-action/issues/56))
|
||||
* `cipher` - the allowed cipher algorithms. If unspecified then a sensible
|
||||
* `envs_format` - flexible configuration of environment value transfer. default is `export {NAME}={VALUE}`
|
||||
|
||||
SSH Proxy Setting:
|
||||
|
||||
|
|
|
@ -65,6 +65,8 @@ inputs:
|
|||
default: false
|
||||
envs:
|
||||
description: 'pass environment variable to shell script'
|
||||
envs_format:
|
||||
description: 'flexible configuration of environment value transfer'
|
||||
debug:
|
||||
description: 'enable debug mode'
|
||||
default: false
|
||||
|
|
Loading…
Reference in a new issue