File tree Expand file tree Collapse file tree 12 files changed +53622
-134
lines changed Expand file tree Collapse file tree 12 files changed +53622
-134
lines changed Original file line number Diff line number Diff line change 33# Check if build output at dist is uptodate or not
44
55# Check files updated in working dir
6+ git diff
67git status dist -s
78
89# Raise error if more than 1 files changed in working dir
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 11name : " Github Action Template"
22author :
" 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
66inputs :
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
1533runs :
16- using : " node12 "
34+ using : " node16 "
1735 main : " dist/index.js"
You can’t perform that action at this time.
0 commit comments