Skip to content

Commit 1500b61

Browse files
author
Greg Bowler
committed
feature: run after command
1 parent 408352f commit 1500b61

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ inputs:
4545
required: true
4646
default: "sudo"
4747

48+
after_command:
49+
description: Command to execute after deployment
50+
required: false
51+
4852
runs:
4953
using: "composite"
5054
steps:
@@ -59,6 +63,7 @@ runs:
5963
ACTION_PATH_OWNER: ${{ inputs.path_owner }}
6064
ACTION_POST_TRANSFER_SCRIPT: ${{ inputs.post_transfer_script }}
6165
ACTION_POST_TRANSFER_SCRIPT_PREFIX: ${{ inputs.post_transfer_script_prefix }}
66+
ACTION_AFTER_COMMAND: ${{ inputs.after_command }}
6267
id: deploy_run
6368
run: ${{ github.action_path }}/deploy-action.bash
6469
shell: bash

deploy-action.bash

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,9 @@ tar -czf - --exclude-vcs . | \
3636
"$ACTION_USER"@"$ACTION_HOSTNAME" \
3737
"rm -rf $full_transfer_path && mkdir -p $full_transfer_path && cd $full_transfer_path && tar -xzf - && mv ./post-transfer.bash $ACTION_POST_TRANSFER_SCRIPT && echo $ACTION_POST_TRANSFER_SCRIPT_PREFIX $ACTION_POST_TRANSFER_SCRIPT && $ACTION_POST_TRANSFER_SCRIPT_PREFIX $ACTION_POST_TRANSFER_SCRIPT"
3838
echo "Transfer complete"
39+
40+
if [ -n "$ACTION_AFTER_COMMAND" ]
41+
then
42+
echo "Running after command: $ACTION_AFTER_COMMAND"
43+
eval "$ACTION_AFTER_COMMAND"
44+
fi

0 commit comments

Comments
 (0)