-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adding Readme file for RemoteSSHCommand.yml GitHub action file
- Loading branch information
1 parent
86e4596
commit f70c88b
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
## Running the bash commands on ec2 instance using private ssh key | ||
|
||
#### [running bash command with ssh workflow](https://github.com/clouddrove/github-shared-workflows/blob/feat/docker-scanner/.github/workflows/RemoteSSHCommand.yml) | ||
|
||
- This workflow is used to run the bash commands on Ec2 instance using the private ssh key and Send the Notification to the particular slack channel after the completion of github-action using the Slack Webhook url. | ||
|
||
#### Usage | ||
|
||
- This workflow is designed to run all the bash commands on Ec2 instance using the private ssh key and also send the Notification to Slack channel after the completion of GitHub-action whether its Pass, fail or cancelled. | ||
|
||
#### Example for running the bash commands on ec2 instance using private ssh key and send notification to Slack channel. | ||
|
||
````yaml | ||
name: Bash-commands with ssh Workflow | ||
permissions: | ||
contents: read | ||
packages: write | ||
pull-requests: write | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
ssh-commands: | ||
uses: clouddrove/github-shared-workflows/.github/workflows/RemoteSSHCommand.yml@master | ||
with: | ||
port: # your_ssh_port | ||
timeout: # your_timeout_in_seconds | ||
command_timeout: # your_command_timeout_in_seconds | ||
slack_message: # your_slack_notification_message | ||
slack_icon: # your_slack_icon_url | ||
slack_username: # your_slack_username | ||
slack_footer: # your_slack_footer | ||
slack_color: # your_slack_color | ||
slack-notification: # Enable or disable Slack notifications (example 'true' or 'false') | ||
script: |- | ||
# Add your bash commands here | ||
secrets: | ||
HOST: # Hostname or IP address of the EC2 instance | ||
PRIVATE_SSH_KEY: # Private SSH key for authenticating with the EC2 instance | ||
USERNAME: # SSH username for connecting to the EC2 instance | ||
SLACK_WEBHOOK_URL: # Slack Webhook URL for sending notifications | ||
|
||
```` |