Skip to content

Commit

Permalink
actions.yml: results-dir not empty check
Browse files Browse the repository at this point in the history
  • Loading branch information
thypon committed Nov 9, 2024
1 parent b018e6e commit dbd11ce
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion actions/main/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,16 @@ runs:
const script = require('${{ github.action_path }}/action.cjs')
await script({github, context, inputs, actionPath, core,
debug: process.env.DEBUG === 'true'})
- name: Upload SARIF file
# execute only if the `../results` directory is not empty
- id: results-dir
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const fs = require('fs')
const path = require('path')
const resultsDir = path.join(__dirname, '..', 'results')
const files = fs.readdirSync(resultsDir)
return files.length > 0
- if: ${{ steps.results-dir.outputs.result == 'true' }}
name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3

0 comments on commit dbd11ce

Please sign in to comment.