bcgov/Test and Analyze with Triggers and SonarCloud

Run node tests based on triggers, optional SonarCloud

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Activelast commit Jun 25, 2026
License
Apache 2.0

Pinned Snippet

workflow.ymlSHA-pinned
uses: bcgov/action-test-and-analyse@8f699e3fd3fadd9a6adf6f4b1f2638ef7ecfefb9 # v2.0.0

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
commandsCommands to run tests, start with '|' for multi-lineyes
dirApp/package directoryyes
node_versionNode version to use (e.g., '24')24
java_versionJava version to use (e.g., '21')21
java_distributionJava distribution to use (e.g., temurin)temurin
python_versionPython version to use (e.g., '3.12')3.12
languagePrimary language of the project. Options: node (default), java, pythonnode
cachePackage manager for caching; e.g. npm, yarn, pnpmnpm
sonar_argsSonarCloud command line arguments-Dsonar.organization=bcgov-sonarcloud -Dsonar.projectKey=bcgov_${{ github.repository }}
sonar_tokenSonar token, provide unpopulated token for pre-setup (will skip)
triggersPaths (array) used to trigger a build; e.g. ('./backend/' './frontend/)
supply_scanEnable supply chain attack detection using @aikidosec/safe-chaintrue
dep_scanEnable dependency and export analysis using Knip for JS/TS projects. Options: off (skip), warn (run but don't fail, default), error (run and fail on issues)warn
knip_configPath to custom Knip configuration file (relative to workspace root). If not provided, uses action's default configuration""
diff_branchBranch to diff against${{ github.event.repository.default_branch }}
repositoryNon-default repository to clone (used for testing this action)${{ github.repository }}
branchNon-default branch to clone (used for testing this action)""
skip_checkoutSkip the internal checkout step. Useful for self-testing or when the project is already checked out.false
checkout_pathPath where the repository should be checked out. Default is current directory..
namedescription
triggeredWhether the action was triggered based on path changes
unused_filesNumber of unused files found by Knip
unused_depsNumber of unused dependencies found by Knip
total_issuesTotal number of issues found by Knip
knip_configThe Knip configuration file that was auto-discovered or specified