diff --git a/.github/workflows/pmd.yml b/.github/workflows/pmd.yml index 751a31a99823..0c34c1875e96 100644 --- a/.github/workflows/pmd.yml +++ b/.github/workflows/pmd.yml @@ -5,9 +5,6 @@ on: branches: [main] pull_request: branches: [main] - schedule: - - cron: '0 0 * * *' - workflow_dispatch: jobs: pmd: @@ -30,19 +27,11 @@ jobs: run: npm ci - name: Validate metadata and build (changed files) - if: github.event_name == 'push' || github.event_name == 'pull_request' run: npx pmd build --changed --no-kill --validate --sarif env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} continue-on-error: true - - name: Validate metadata and build (all files) - if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' - run: npx pmd build --all --no-kill --validate --sarif - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - continue-on-error: true - - name: Upload analysis results to GitHub uses: github/codeql-action/upload-sarif@v3 with: diff --git a/cli/src/util/sarif.ts b/cli/src/util/sarif.ts index 296a888451ee..ae64ec46b80e 100644 --- a/cli/src/util/sarif.ts +++ b/cli/src/util/sarif.ts @@ -1,7 +1,6 @@ import { writeFile } from 'node:fs/promises' import { resolve } from 'node:path' import process from 'node:process' -import { pathToFileURL } from 'node:url' import { getCliPackageJson } from './getPackageJson.js' export enum SarifRuleId { @@ -107,7 +106,8 @@ export function addSarifLog(log: { column: number } }) { - log.path = log.path.replace(process.cwd(), '') + // Remove the cwd from the path. And remove the leading slash. + log.path = log.path.replace(process.cwd(), '').slice(1) if (typeof sarifArtifactIndices[log.path] === 'undefined') { sarifArtifactIndices[log.path] = nextArtifactIndex++ @@ -115,7 +115,7 @@ export function addSarifLog(log: { // Create a new entry in the files dictionary. sarifFiles[log.path] = { location: { - uri: pathToFileURL(log.path).toString(), + uri: log.path, }, } } @@ -133,7 +133,7 @@ export function addSarifLog(log: { { physicalLocation: { artifactLocation: { - uri: pathToFileURL(log.path), + uri: log.path, index: sarifArtifactIndices[log.path], }, ...(log.position && log.position.line > 0