Skip to content

Commit 5ac43dd

Browse files
authored
chore(ssh): pass all ENV variables to script (#259)
1 parent a01d3ea commit 5ac43dd

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,23 @@ jobs:
198198
echo "I am $BAR, thanks"
199199
echo "I am $TEST_AAA, thanks"
200200
201+
- name: pass all ENV variables to script
202+
uses: ./
203+
env:
204+
INPUT_FOO: "BAR"
205+
INPUT_AAA: "BBB"
206+
with:
207+
host: ${{ secrets.HOST }}
208+
username: ${{ secrets.USERNAME }}
209+
key: ${{ secrets.KEY }}
210+
port: ${{ secrets.PORT }}
211+
allenvs: true
212+
script: |
213+
echo "I am $INPUT_FOO, thanks"
214+
echo "I am $INPUT_AAA, thanks"
215+
echo "$GITHUB_BASE_REF"
216+
echo "$GITHUB_REF"
217+
201218
testing03:
202219
name: git clone and pull
203220
runs-on: ubuntu-latest
@@ -245,3 +262,4 @@ jobs:
245262
script_stop: true
246263
script: |
247264
echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
265+

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/appleboy/drone-ssh:1.6.14
1+
FROM ghcr.io/appleboy/drone-ssh:1.7.0
22

33
COPY entrypoint.sh /entrypoint.sh
44
RUN chmod +x /entrypoint.sh

action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ inputs:
6565
description: 'Flexible configuration for environment value transfer.'
6666
debug:
6767
description: 'Enable debug mode.'
68+
allenvs:
69+
description: 'pass all environment variable to shell script.'
6870
runs:
6971
using: 'docker'
7072
image: 'Dockerfile'

0 commit comments

Comments
 (0)