Skip to content

Commit 57833f7

Browse files
authored
Merge pull request #1 from debugger24/feature/initial-implementation
Initial implementation
2 parents 853ef42 + 600971d commit 57833f7

File tree

12 files changed

+53622
-134
lines changed

12 files changed

+53622
-134
lines changed

.github/scripts/verify-build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Check if build output at dist is uptodate or not
44

55
# Check files updated in working dir
6+
git diff
67
git status dist -s
78

89
# Raise error if more than 1 files changed in working dir

.github/workflows/build-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Setup node
2323
uses: actions/setup-node@v3
2424
with:
25-
node-version: 12
25+
node-version: 16
2626

2727
- name: Install dependencies
2828
run: npm install

.github/workflows/feature-branch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup node
1717
uses: actions/setup-node@v3
1818
with:
19-
node-version: 12
19+
node-version: 16
2020

2121
- name: Install dependencies
2222
run: npm install

.github/workflows/test-branch.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Test Workflow
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
instance_id_linux:
7+
description: Instance ID to execute AWS SSM command
8+
required: true
9+
10+
env:
11+
AWS_REGION: ap-south-1
12+
13+
jobs:
14+
test-linux:
15+
runs-on: ubuntu-latest
16+
name: Test Linux
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
- name: Configure AWS Credentials
21+
uses: aws-actions/configure-aws-credentials@v1
22+
with:
23+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
24+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
25+
aws-region: ${AWS_REGION}
26+
- name: Test Linux
27+
id: test-linux
28+
uses: ./
29+
with:
30+
aws-region: ${AWS_REGION}
31+
instance-ids: ${{ github.event.inputs.instance_id_linux }}
32+
commands: |
33+
pwd
34+
ls
35+
echo "Executed by Github Actions Workflow #${{ github.run_id }}" >> test.txt

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# github-action-template
2-
Template Repo for GitHub action with CI/CD
1+
# GitHub Action - AWS SSM Run Command
2+
3+
Github Action for running commands on Linux or Windows machine managed using SSM

action.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,35 @@
11
name: "Github Action Template"
22
author: "Rahul Kumar <[email protected]>"
33

4-
description: "Github Action Template with CI/CD"
4+
description: "Github Action for running commands on Linux or Windows machine managed using SSM"
55

66
inputs:
7-
sample_input_1:
7+
aws-region:
88
required: true
9-
description: "Sample Input 1"
10-
optional_sample_input_2:
9+
description: "AWS Region"
10+
instance-ids:
11+
required: true
12+
description: "List of Instance IDs to execute command"
13+
commands:
14+
required: true
15+
description: "Commands to be executed on instance"
16+
os:
17+
required: false
18+
description: "(Optional) Operating system to run commands (windows or linux)"
19+
default: linux
20+
working-directory:
1121
required: false
12-
description: "Optional Sample Input 2"
13-
default: "default_value"
22+
description: "(Optional) Working directory for command execution"
23+
default: ""
24+
comment:
25+
required: false
26+
description: "(Optional) Comment"
27+
default: "Executed by Github Actions Workflow #${{ github.run_id }}"
28+
29+
outputs:
30+
command-id:
31+
description: "Execution command ID generated by AWS send command API"
1432

1533
runs:
16-
using: "node12"
34+
using: "node16"
1735
main: "dist/index.js"

0 commit comments

Comments
 (0)