Skip to content

Commit bccfe51

Browse files
authored
Update main.yml
1 parent f24aca0 commit bccfe51

File tree

1 file changed

+30
-79
lines changed

1 file changed

+30
-79
lines changed

.github/workflows/main.yml

Lines changed: 30 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,41 @@
1-
name: Build NPM Package
1+
name: TypeScript x InvisiRisk
2+
23
on:
3-
workflow_dispatch:
4+
workflow_dispatch:
45

56
permissions:
67
checks: write
7-
contents: read
8+
contents: write
89
packages: read
9-
env:
10-
API_URL: https://app.veribom.com
1110

1211
jobs:
13-
create_scan_in_IR_Portal:
14-
runs-on: ubuntu-latest
15-
outputs:
16-
scan_id: ${{ steps.parseResponse.outputs.scan_id }}
17-
steps:
18-
- name: Initiating SBOM Scan
19-
id: createScan
20-
uses: fjogeleit/http-request-action@v1.15.1
21-
with:
22-
url: '${{env.API_URL}}/utilityapi/v1/scan'
23-
method: 'POST'
24-
data: '{"api_key": "${{secrets.VB_API_KEY}}"}'
25-
- name: Parse Response
26-
id: parseResponse
27-
run: echo "scan_id=${{fromJSON(steps.createScan.outputs.response).data.scan_id}}" >> "$GITHUB_OUTPUT"
28-
ecr_details:
12+
python-application-build:
2913
runs-on: ubuntu-latest
30-
outputs:
31-
ecr_username: ${{steps.ecr_details.outputs.username}}
32-
ecr_token: ${{steps.ecr_details.outputs.token}}
33-
ecr_region: ${{steps.ecr_details.outputs.region}}
34-
ecr_id: ${{steps.ecr_details.outputs.registry_id}}
14+
name: Run build
3515
steps:
36-
- name: Fetching VB Token
37-
id: fetchECRDetails
38-
uses: fjogeleit/http-request-action@v1.15.1
16+
- name: Setup PSE
17+
uses: invisirisk/pse-action@latest
3918
with:
40-
url: '${{env.API_URL}}/utilityapi/v1/registry?api_key=${{secrets.VB_API_KEY}}'
41-
method: 'GET'
42-
- name: Decoding VB Token
43-
id: parseToken
44-
run: echo "DECODED_TOKEN=$(echo ${{ fromJson(steps.fetchECRDetails.outputs.response).data }} | base64 -d)" >> "$GITHUB_OUTPUT"
45-
- name: ECR Details
46-
id: ecr_details
47-
run: |
48-
echo "username=${{fromJSON(steps.parseToken.outputs.DECODED_TOKEN).username}}" >> "$GITHUB_OUTPUT"
49-
echo "token=${{fromJSON(steps.parseToken.outputs.DECODED_TOKEN).password}}" >> "$GITHUB_OUTPUT"
50-
echo "region=${{fromJSON(steps.parseToken.outputs.DECODED_TOKEN).region}}" >> "$GITHUB_OUTPUT"
51-
echo "registry_id=${{fromJSON(steps.parseToken.outputs.DECODED_TOKEN).registry_id}}" >> "$GITHUB_OUTPUT"
19+
api_url: "https://app.invisirisk.com"
20+
app_token: ${{ secrets.VB_API_KEY }}
5221

53-
start_proxy_and_build:
54-
runs-on: ubuntu-latest
55-
needs: [create_scan_in_IR_Portal, ecr_details]
56-
services:
57-
pse:
58-
image: 282904853176.dkr.ecr.us-west-2.amazonaws.com/invisirisk/pse-proxy:latest
59-
credentials:
60-
username: ${{needs.ecr_details.outputs.ecr_username}}
61-
password: ${{needs.ecr_details.outputs.ecr_token}}
62-
env:
63-
PSE_DEBUG_FLAG: --alsologtostderr
64-
POLICY_LOG: t
65-
INVISIRISK_JWT_TOKEN: ${{secrets.VB_API_KEY}}
66-
INVISIRISK_PORTAL: https://app.veribom.com
67-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68-
container:
69-
image: node:18-alpine
70-
options: --cap-add=NET_ADMIN
71-
strategy:
72-
matrix:
73-
node-version: [18.x]
74-
steps:
75-
- env:
76-
SCAN_ID: ${{ needs.create_scan_in_IR_Portal.outputs.scan_id }}
77-
run: echo $SCAN_ID
78-
- uses: invisirisk/pse-action@v1.0.8
79-
with:
80-
github-token: ${{ secrets.GITHUB_TOKEN }}
81-
SCAN_ID: ${{ needs.create_scan_in_IR_Portal.outputs.scan_id }}
82-
- name: Checkout the code
83-
uses: actions/checkout@v3
84-
- name: Use Node.js ${{ matrix.node-version }}
85-
uses: actions/setup-node@v3
86-
with:
87-
node-version: ${{ matrix.node-version }}
88-
89-
- run: npm install -g pnpm
90-
- run: pnpm install
22+
- uses: actions/checkout@v4
23+
24+
- name: Use npm
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: '18'
28+
29+
- name: Install dependencies
30+
run: npm install
31+
32+
#- name: 😈 Execute malicious script
33+
#run: bash run_malicious_scripts.sh
34+
- name: Cleanup PSE
35+
if: always()
36+
uses: invisirisk/pse-action@latest
37+
with:
38+
cleanup: "true"
39+
40+
41+

0 commit comments

Comments
 (0)