diff --git a/.github/workflows/codeAnalyzerOnPR.yml b/.github/workflows/codeAnalyzerOnPR.yml index fdf9032..055a8b9 100644 --- a/.github/workflows/codeAnalyzerOnPR.yml +++ b/.github/workflows/codeAnalyzerOnPR.yml @@ -1,4 +1,4 @@ -name: Salesforce Code Analyzer on PR +name: Salesforce Code Analyzer - on pull request on: pull_request: @@ -22,26 +22,18 @@ jobs: - name: Get changed files id: changed-files uses: tj-actions/changed-files@v44 - - - name: List all changed files - env: - ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} - run: | - for file in ${ALL_CHANGED_FILES}; do - echo "$file was changed" - done - + - name: Run Salesforce Code Analyzer id: run-code-analyzer uses: forcedotcom/run-code-analyzer@v1 with: run-command: run - run-arguments: --normalize-severity --target ${ALL_CHANGED_FILES} --outfile results.html + run-arguments: --normalize-severity --target ${{ steps.changed-files.outputs.all_changed_files }} --outfile results.html results-artifact-name: salesforce-code-analyzer-results - name: Check the outputs to determine whether to fail if: | steps.run-code-analyzer.outputs.exit-code > 0 || steps.run-code-analyzer.outputs.num-sev1-violations > 0 || - steps.run-code-analyzer.outputs.num-violations > 10 + steps.run-code-analyzer.outputs.num-violations > 0 run: exit 1 diff --git a/force-app/main/default/classes/DummyClass.cls b/force-app/main/default/classes/DummyClass.cls index d33a689..9fcc1b0 100644 --- a/force-app/main/default/classes/DummyClass.cls +++ b/force-app/main/default/classes/DummyClass.cls @@ -5,6 +5,7 @@ public with sharing class DummyClass { } public static String getStatic(){ + String a = 'Analiza o código'; return a; diff --git a/manifest/buildfile.json b/manifest/buildfile.json index 7918384..be415ea 100644 --- a/manifest/buildfile.json +++ b/manifest/buildfile.json @@ -4,7 +4,7 @@ "type": "metadata", "manifestFile": "manifest/package.xml", "testLevel": "RunSpecifiedTests", - "classPath": "force-app/main/default", + "classPath": "force-app/main/default/classes", "timeout": "33", "ignoreWarnings": true },