Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nixel2007/sonarcloud-github-action
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.4
Choose a base ref
...
head repository: nixel2007/sonarcloud-github-action
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.5
Choose a head ref
  • 14 commits
  • 4 files changed
  • 14 contributors

Commits on Jan 11, 2021

  1. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    danielleadams Danielle Adams
    Copy the full SHA
    32ea611 View commit details

Commits on Apr 13, 2021

  1. Copy the full SHA
    4fed942 View commit details
  2. Copy the full SHA
    de2e56b View commit details

Commits on Apr 19, 2021

  1. Set up locale env variables (SonarSource#14)

    Setting those variables fixes the issue that sonar has with non-asci chars in filenames
    
    Co-authored-by: Tom <[email protected]>
    Copy the full SHA
    5c2f7d2 View commit details

Commits on Jun 11, 2021

  1. Copy the full SHA
    110d465 View commit details

Commits on Sep 16, 2021

  1. Remove warning about not using for .NET (SonarSource#26)

    * Remove warning about not using for .NET
    
    * Update instruction for analyzing a .NET solution
    
    Co-authored-by: Tom Howlett (Sonarsource) <[email protected]>
    Copy the full SHA
    5392662 View commit details

Commits on Dec 9, 2021

  1. Add link to sample repo with more examples (SonarSource#30)

    Co-authored-by: Janos Gyerik <[email protected]>
    colin-sonarsource and Janos Gyerik authored Dec 9, 2021
    Copy the full SHA
    edb8ada View commit details

Commits on Jan 12, 2022

  1. Copy the full SHA
    4338a69 View commit details

Commits on Mar 17, 2022

  1. Copy the full SHA
    25b0be1 View commit details

Commits on Aug 15, 2022

  1. Copy the full SHA
    64d3b08 View commit details
  2. Copy the full SHA
    156db6f View commit details

Commits on Nov 21, 2022

  1. Copy the full SHA
    bc5ac10 View commit details
  2. Copy the full SHA
    cb201f3 View commit details

Commits on Dec 19, 2022

  1. Copy the full SHA
    1954da0 View commit details
Showing with 18 additions and 10 deletions.
  1. +1 −0 .github/CODEOWNERS
  2. +4 −1 Dockerfile
  3. +10 −6 README.md
  4. +3 −3 entrypoint.sh
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.github/CODEOWNERS @sonarsource/sonarcloud
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM astrizhachuk/sonar-scanner-cli:4.3.0.2102
FROM astrizhachuk/sonar-scanner-cli:4.6.2.2472

LABEL version="0.0.1" \
repository="https://github.com/sonarsource/sonarcloud-github-action" \
@@ -14,6 +14,9 @@ ARG NODEJS_HOME=/opt/nodejs

ENV PATH=${PATH}:${SONAR_SCANNER_HOME}/bin:${NODEJS_HOME}/bin

# set up local envs in order to allow for special chars (non-asci) in filenames
ENV LC_ALL="C.UTF-8"

WORKDIR /opt

# https://help.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Scan your code with SonarCloud

Using this GitHub Action, scan your code with [SonarCloud](https://sonarcloud.io/) to detects bugs, vulnerabilities and code smells in more than 20 programming languages!
In case you want to analyze C and C++ code: rely on our [SonarCloud Scan for C and C++](https://github.com/marketplace/actions/sonarcloud-scan-for-c-and-c) and look at [our sample C and C++ project](https://github.com/sonarsource-cfamily-examples?q=gh-actions-sc&type=all&language=&sort=)

<img src="./images/SonarCloud-72px.png">

SonarCloud is the leading product for Continuous Code Quality & Code Security online, totally free for open-source projects. It supports all major programming languages, including Java, JavaScript, TypeScript, C#, C/C++ and many more. If your code is closed source, SonarCloud also offers a paid plan to run private analyses.
SonarCloud is the leading product for Continuous Code Quality & Code Security online, totally free for open-source projects. It supports all major programming languages, including Java, JavaScript, TypeScript, C#, [C and C++](https://github.com/marketplace/actions/sonarcloud-scan-for-c-and-c) and many more. If your code is closed source, SonarCloud also offers a paid plan to run private analyses.

## Requirements

@@ -20,7 +21,7 @@ sonar.organization=<replace with your SonarCloud organization key>
sonar.projectKey=<replace with the key generated when setting up the project on SonarCloud>

# relative paths to source directories. More details and properties are described
# in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/
# in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/
sonar.sources=.
```

@@ -29,7 +30,7 @@ The workflow, usually declared in `.github/workflows/build.yml`, looks like:
```yaml
on:
# Trigger analysis when pushing in master or pull requests, and when creating
# a pull request.
# a pull request.
push:
branches:
- master
@@ -77,7 +78,10 @@ In case you need to add additional analysis parameters, you can use the `args` o
```

More information about possible analysis parameters is found in the documentation at:
https://sonarcloud.io/documentation/analysis/analysis-parameters/
https://docs.sonarcloud.io/advanced-setup/analysis-parameters

See also example configurations at:
https://github.com/sonarsource/sonarcloud-github-action-samples/

### Secrets

@@ -92,8 +96,8 @@ https://sonarcloud.io/documentation/analysis/analysis-parameters/

* Your code is built with Maven: run 'org.sonarsource.scanner.maven:sonar' during the build
* Your code is built with Gradle: use the SonarQube plugin for Gradle during the build
* You want to analyze a .NET solution: use the [SonarCloud Azure DevOps Extension](https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarcloud) to analyze your code on SonarCloud with Azure Pipelines
* You want to analyze C/C++ code: rely on our [Travis-CI extension](https://docs.travis-ci.com/user/sonarcloud/) and look at [our sample C/C++ project](https://github.com/SonarSource/sq-com_example_c-sqscanner-travis)
* You want to analyze a .NET solution: Follow our interactive tutorial for Github Actions after importing your project directly in SonarCloud
* You want to analyze C and C++ code: rely on our [SonarCloud Scan for C and C++](https://github.com/marketplace/actions/sonarcloud-scan-for-c-and-c) and look at [our sample C and C++ project](https://github.com/sonarsource-cfamily-examples?q=gh-actions-sc&type=all&language=&sort=)

## Have question or feedback?

6 changes: 3 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -7,18 +7,18 @@ if [[ -z "${SONAR_TOKEN}" ]]; then
exit 1
fi

if [[ -f "pom.xml" ]]; then
if [[ -f "${INPUT_PROJECTBASEDIR%/}/pom.xml" ]]; then
echo "Maven project detected. You should run the goal 'org.sonarsource.scanner.maven:sonar' during build rather than using this GitHub Action."
exit 1
fi

if [[ -f "build.gradle" ]]; then
if [[ -f "${INPUT_PROJECTBASEDIR%/}/build.gradle" ]]; then
echo "Gradle project detected. You should use the SonarQube plugin for Gradle during build rather than using this GitHub Action."
exit 1
fi

if [[ -z "${SONARCLOUD_URL}" ]]; then
SONARCLOUD_URL="https://sonarcloud.io"
fi

unset JAVA_HOME
sonar-scanner -Dsonar.projectBaseDir=${INPUT_PROJECTBASEDIR} -Dsonar.host.url=${SONARCLOUD_URL} ${INPUT_ARGS}