Skip to content

Commit

Permalink
lib: escape unpublishedCVEs
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelGSS committed Dec 12, 2023
1 parent 7f4cf25 commit f9908d5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 44 deletions.
79 changes: 36 additions & 43 deletions .github/workflows/checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,53 +8,46 @@ permissions:
issues: write

jobs:
job1:
runs-on: ubuntu-latest
outputs:
CVEs: ${{ steps.validator.outputs.CVEs }}
steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'

- name: Install
run: |
npm install
- name: Run validator
id: validator
env:
API_KEY: ${{ secrets.API_KEY }}
run: |
node index.js
echo:
needs: job1
runs-on: ubuntu-latest
steps:
- name: echo output
env:
OUTPUT: ${{ toJson(needs.job1) }}
run: |
echo "$OUTPUT"
# check:
# runs-on: ubuntu-latest
# outputs:
# CVEs: ${{ steps.validator.outputs.CVEs }}
# steps:
# - uses: actions/checkout@v3

# - name: Use Node.js
# uses: actions/setup-node@v3
# with:
# node-version: '20.x'

# - name: Install
# run: |
# npm install

# - name: Run validator
# id: validator
# env:
# API_KEY: ${{ secrets.API_KEY }}
# run: |
# node index.js

create-issues:
needs: job1
# needs: check
if: ${{ success() }}
runs-on: ubuntu-latest
strategy:
matrix: ${{ needs.job1.outputs.CVEs }}
matrix: ${{ fromJSON('"[\"CVE-2023-30587\"]"') }}
max-parallel: 1
steps:
- uses: actions/checkout@v3
- uses: dblock/create-a-github-issue@v3
with:
update_existing: false
search_existing: all
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CVE_ID: ${{ matrix }}
ACTION_URL: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- name: Install-${{ matrix }}
run: |
echo "Running ${{ matrix }}"
# - uses: actions/checkout@v3
# - uses: dblock/create-a-github-issue@v3
# with:
# update_existing: false
# search_existing: all
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# CVE_ID: ${{ matrix }}
# ACTION_URL: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async function main () {
const cve = coreIndex[idx].cve[0]
const published = await isCVEPublished(cve)
if (!published) {
unpublishedCVEs.push(cve)
unpublishedCVEs.push(`"${cve}"`)
core.warning(`⚠️ ${cve} wasn't published.`)
break
}
Expand Down

0 comments on commit f9908d5

Please sign in to comment.