Skip to content

Commit 9ebfc65

Browse files
committed
Code rabbit suggestions implemented
1 parent b383bce commit 9ebfc65

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/aquasec_repo_scan.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
STRING_TO_SIGN="${TIMESTAMP}${METHOD}/v2/tokens${POST_BODY}"
5151
SIGNATURE=$(echo -n "$STRING_TO_SIGN" | openssl dgst -sha256 -hmac "${AQUA_SECRET}" -hex | sed 's/.*= //g')
5252
53-
AUTH_RESPONSE=$(curl -s -X $METHOD "$AUTH_ENDPOINT" \
53+
AUTH_RESPONSE=$(curl -s --max-time 30 -X $METHOD "$AUTH_ENDPOINT" \
5454
-H "Content-Type: application/json" \
5555
-H "X-API-Key: $AQUA_KEY" \
5656
-H "X-Timestamp: $TIMESTAMP" \
@@ -80,7 +80,7 @@ jobs:
8080
8181
REQUEST_URL="${SCAN_RESULTS_ENDPOINT}?repositoryIds=${REPOSITORY_ID}&size=${PAGE_SIZE}&page=${PAGE_NUM}"
8282
83-
PAGE_RESPONSE=$(curl -s -X GET "$REQUEST_URL" \
83+
PAGE_RESPONSE=$(curl -s --max-time 30 -X GET "$REQUEST_URL" \
8484
-H "Authorization: Bearer $BEARER_TOKEN" \
8585
-H "Accept: application/json")
8686
@@ -326,14 +326,16 @@ jobs:
326326
- name: GitHub scan summary comment
327327
if: github.event_name == 'pull_request'
328328
uses: actions/github-script@v8
329+
env:
330+
SUMMARY_TABLE: ${{ steps.scan_summary_table.outputs.table }}
329331
with:
330332
github-token: ${{ secrets.GITHUB_TOKEN }}
331333
script: |
332334
const link = `https://github.com/${context.repo.owner}/${context.repo.repo}/security/code-scanning?query=pr%3A${context.issue.number}+is%3Aopen`;
333335
const sentence = `AquaSec has completed a full security repository scan ✅ You can find the analysis results for this PR branch on [this overview](${link}).\n Below is the summary of the findings:`;
334-
const summaryTable = `${{ steps.scan_summary_table.outputs.table }}`;
335-
const body = `${sentence}\n\n${summaryTable}`;
336-
github.rest.issues.createComment({
336+
const summaryTable = process.env.SUMMARY_TABLE;
337+
const body = sentence + "\n\n" + summaryTable;
338+
await github.rest.issues.createComment({
337339
issue_number: context.issue.number,
338340
owner: context.repo.owner,
339341
repo: context.repo.repo,

0 commit comments

Comments
 (0)