Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dolisss authored Jan 12, 2025
1 parent 9a0585e commit 83f840d
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CDK Scan Pipeline Demo
run-name: ${{ github.actor }} has triggered Scan Action 🚀
on:
pull_request:
branches:
- "main"
push:
branches:
- "main"

env:
NIRMATA_TOKEN: ${{ secrets.NIRMATA_TOKEN }}
NIRMATA_URL: ${{ secrets.NIRMATA_URL }}

jobs:
NCTL-Scan-CDK:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."

- name: Check out main repository code
uses: actions/checkout@v4

- name: NCTL-scan-installer
uses: supplypike/setup-bin@v4
with:
uri: 'https://nirmata-downloads.s3.us-east-2.amazonaws.com/nctl/nctl_4.2.2-rc.1/nctl_4.2.2-rc.1_linux_386.zip'
name: 'nctl'
version: '4.2.2-rc.1'

- name: Check nctl version
run: |
nctl version
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.9"

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18' # Specify the Node.js version you want to use

- name: Install dependencies
run: npm install

- name: Install Python dependencies and CDK
run: |
python -m pip install --upgrade pip
cd sample-cdk
pip install -r requirements.txt
npm install -g aws-cdk
- name: CDK Synth
run: |
cd sample-cdk
cdk synth --json
# - name: nctl login
# run: nctl login --url $NIRMATA_URL --userid [email protected] --token $NIRMATA_TOKEN

# - name: file-o/p
# run: |
# cat sample-cdk/cdk.out/MyEcsStack.template.json

- name: NCTL Scan Repository for CDK
run: |
nctl scan json -r sample-cdk/cdk.out/MyEcsStack.template.json --policies https://github.com/nirmata/change-mgmt-demo/tree/main/policies --details --publish
- run: echo "🍏 This job's status is ${{ job.status }}."

0 comments on commit 83f840d

Please sign in to comment.