get rid of unused js scan
@@ -103,52 +103,3 @@ jobs:
with:
name: semgrep-python-report
path: /home/runner/reports/semgrep.out
- javascript_scan:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- with:
- repository: ${{ github.event.pull_request.head.repo.full_name }}
- ref: ${{ github.event.pull_request.head.ref }}
- - name: scan
- id: js_scan
- run: |
- export DEBIAN_FRONTEND=noninteractive && \
- echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections && \
- sudo apt-get update && \
- sudo apt install jq && \
- python3 -m pip install --upgrade pip && \
- python3 -m pip install semgrep && \
- python3 -m pip install --upgrade urllib3 && \
- mkdir -p /home/runner/reports/ && \
- cd ${GITHUB_WORKSPACE}/ && \
- semgrep --config=.github/workflows/config/semgrep-js.yml --json -o /home/runner/reports/semgrep.out \
- --severity ERROR ./ && \
- echo "## Validation Issues Found (JavaScript) :atom_symbol: " >> /home/runner/reports/javascript-msg && \
- cat /home/runner/reports/semgrep.out | jq -r --arg ws "$GITHUB_WORKSPACE" --arg url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/blob/$GITHUB_SHA" '.results[] | "**File:** [\(.path | sub($ws; "."; "g"))](\(.path | sub($ws; $url; "g"))#L\(.start.line)) \n**Line Number:** \(.start.line) \n**Statement(s):** \n``` \n\(.extra.lines) \n``` \n**Rule:** \n\(.extra.message)\n\n"' >> /home/runner/reports/javascript-msg && \
- echo "::set-output name=js-found-count::$(cat /home/runner/reports/semgrep.out | jq '.results | length')"
- - name: Fail if found
- if: steps.js_scan.outputs.js-found-count > 0
- uses: actions/github-script@v6
- with:
- github-token: ${{secrets.GITHUB_TOKEN}}
- script: |
- const fs = require('fs')
-
- var msg = fs.readFileSync('/home/runner/reports/javascript-msg', 'utf8');
- console.log('${{steps.js_scan.outputs.js-found-count}} errors found in javascript files');
- console.log(msg);
- github.rest.issues.createComment({
- issue_number: context.issue.number,
- owner: context.repo.owner,
- repo: context.repo.repo,
- body: msg
- });
-
- core.setFailed('Semgrep found errors in JavaScript files. Please check the uploaded report');
- - name: Upload scan reports
- uses: actions/upload-artifact@v2.3.1
- if: failure()
- with:
- name: semgrep-js-report
- path: /home/runner/reports/semgrep.out
\ No newline at end of file
