Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1988863
SCSCANGHA-3 Update the condition to detect "build.gradle.kts" files …
leveretka May 8, 2024
0861f01
SCSCANGHA-6 Add Github Actions tests
antoine-vinot-sonarsource May 13, 2024
3da91d8
SCSCANGHA-6 Fix main branch name in GitHub workflow
antoine-vinot-sonarsource May 16, 2024
49689c4
SCSCANGHA-9 Enable Mend scan
antoine-vinot-sonarsource May 20, 2024
1373cf7
SCSCANGHA-14 Enable debug logging when GitHub Actions debug logging i…
ari-becker May 21, 2024
714bd35
SCSCANGHA-15 Add test for scanner debug logging (#77)
istvan-bodo-sonarsource May 22, 2024
f1d5a2a
SCSCANGHA-13 Warning instead of failure for Maven/Gradle projects
antoine-vinot-sonarsource May 20, 2024
a69a8ed
SCSCANGHA-5 Update the base image
antoine-vinot-sonarsource May 22, 2024
d08d592
SCSCANGHA-16 Support passing args with spaces (#79)
istvan-bodo-sonarsource May 23, 2024
9c11606
Use a placeholder for the action version in README
antoine-vinot-sonarsource May 23, 2024
4006f66
SC-6818 drop GH token from README
bogdanakushnir Feb 9, 2023
13d84ab
SCSCANGHA-18 Add workflow to automate tags creation upon release
antoine-vinot-sonarsource May 23, 2024
e44258b
Revert "SCSCANGHA-16 Support passing args with spaces (#79)" (#83)
csaba-feher-sonarsource Jun 13, 2024
f4a7a62
NO-JIRA Prevent globbing and word splitting (#84)
vil02 Jul 12, 2024
b7cc8bf
NO-JIRA Bump cirrus module version
antoine-vinot-sonarsource Jul 12, 2024
3bf6e4b
test QA with no GITHUB_TOKEN permissions
pierre-guillot-gh Jul 24, 2024
f5003fc
Revert "test QA with no GITHUB_TOKEN permissions"
pierre-guillot-gh Jul 24, 2024
eb21172
SCSCANGHA-23 Update scanner cli to v11.0 (#90)
istvan-bodo-sonarsource Aug 20, 2024
2900b02
BUILD-6088 Fix bad link in SECURITY.md file
SamirM-BE Aug 23, 2024
383f7e5
SCSCANGHA-24 Update the Docker base image to the latest minor 11.1
henryju Oct 3, 2024
9f9bba2
Recommend to not use this action for analysis of Dart code
Godin Oct 11, 2024
982992a
Add Jira integration
pavel-mikula-sonarsource Nov 27, 2024
48d9e10
SCSCANGHA-25 Replace the Docker action by a composite action forwardi…
antonioaversa Oct 31, 2024
4afec88
SCSCANGHA-28 Rebranding
antonioaversa Nov 19, 2024
02ef911
Shorten description and remove mend docker check
antonioaversa Dec 5, 2024
f170077
SCSCANGHA-37 Update CODEOWNERS (#100)
pierre-guillot-gh Feb 7, 2025
0f7db25
fix dockerfile
Tudgwal Feb 19, 2025
8afd7b3
Update Dockerfile
YoranSys Sep 18, 2023
c241aa3
Permit usage of CACHE_DOCKER_REGISTRY_URL
YoranSys Sep 18, 2023
1656898
Update harbor url
YoranSys Dec 18, 2023
fd96f2d
Merge branch 'SonarSource-master'
Tudgwal Feb 19, 2025
7406097
fix dockerfile
Tudgwal Feb 19, 2025
097540e
fix dockerfile
Tudgwal Feb 19, 2025
942b034
fix dockerfile
Tudgwal Feb 19, 2025
3cd5180
fix dockerfile
Tudgwal Feb 19, 2025
9315216
fix dockerfile
Tudgwal Feb 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .cirrus/wss-unified-agent.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
docker.projectNameFormat=repositoryNameAndTag
docker.scanImages=true
wss.url=https://saas-eu.whitesourcesoftware.com/agent
productName=GitHubAction/SonarCloudGitHubAction
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.github/CODEOWNERS @sonarsource/analysis-experience-squad
.github/CODEOWNERS @sonarsource/orchestration-processing-squad
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Part of
<!--
Only for standalone PRs without Jira issue in the PR title:
* Replace this comment with Epic ID to create a new Task in Jira
* Replace this comment with Issue ID to create a new Sub-Task in Jira
* Ignore or delete this note to create a new Task in Jira without a parent
-->
29 changes: 29 additions & 0 deletions .github/workflows/PullRequestClosed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Pull Request Closed

on:
pull_request:
types: [closed]

jobs:
PullRequestMerged_job:
name: Pull Request Merged
runs-on: ubuntu-latest
permissions:
id-token: write
pull-requests: read
# For external PR, ticket should be moved manually
if: |
github.event.pull_request.head.repo.full_name == github.repository
&& github.event.pull_request.merged
steps:
- id: secrets
uses: SonarSource/vault-action-wrapper@v3
with:
secrets: |
development/kv/data/jira user | JIRA_USER;
development/kv/data/jira token | JIRA_TOKEN;
- uses: sonarsource/gh-action-lt-backlog/PullRequestClosed@v2
with:
github-token: ${{secrets.GITHUB_TOKEN}}
jira-user: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_USER }}
jira-token: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/PullRequestCreated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Pull Request Created

on:
pull_request:
types: ["opened"]

jobs:
PullRequestCreated_job:
name: Pull Request Created
runs-on: ubuntu-latest
permissions:
id-token: write
# For external PR, ticket should be created manually
if: |
github.event.pull_request.head.repo.full_name == github.repository
steps:
- id: secrets
uses: SonarSource/vault-action-wrapper@v3
with:
secrets: |
development/github/token/{REPO_OWNER_NAME_DASH}-jira token | GITHUB_TOKEN;
development/kv/data/jira user | JIRA_USER;
development/kv/data/jira token | JIRA_TOKEN;
- uses: sonarsource/gh-action-lt-backlog/PullRequestCreated@v2
with:
github-token: ${{ fromJSON(steps.secrets.outputs.vault).GITHUB_TOKEN }}
jira-user: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_USER }}
jira-token: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_TOKEN }}
jira-project: SCSCANGHA
28 changes: 28 additions & 0 deletions .github/workflows/RequestReview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Request review

on:
pull_request:
types: ["review_requested"]

jobs:
RequestReview_job:
name: Request review
runs-on: ubuntu-latest
permissions:
id-token: write
# For external PR, ticket should be moved manually
if: |
github.event.pull_request.head.repo.full_name == github.repository
steps:
- id: secrets
uses: SonarSource/vault-action-wrapper@v3
with:
secrets: |
development/github/token/{REPO_OWNER_NAME_DASH}-jira token | GITHUB_TOKEN;
development/kv/data/jira user | JIRA_USER;
development/kv/data/jira token | JIRA_TOKEN;
- uses: sonarsource/gh-action-lt-backlog/RequestReview@v2
with:
github-token: ${{ fromJSON(steps.secrets.outputs.vault).GITHUB_TOKEN }}
jira-user: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_USER }}
jira-token: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_TOKEN }}
30 changes: 30 additions & 0 deletions .github/workflows/SubmitReview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Submit Review

on:
pull_request_review:
types: [submitted]

jobs:
SubmitReview_job:
name: Submit Review
runs-on: ubuntu-latest
permissions:
id-token: write
pull-requests: read
# For external PR, ticket should be moved manually
if: |
github.event.pull_request.head.repo.full_name == github.repository
&& (github.event.review.state == 'changes_requested'
|| github.event.review.state == 'approved')
steps:
- id: secrets
uses: SonarSource/vault-action-wrapper@v3
with:
secrets: |
development/kv/data/jira user | JIRA_USER;
development/kv/data/jira token | JIRA_TOKEN;
- uses: sonarsource/gh-action-lt-backlog/SubmitReview@v2
with:
github-token: ${{secrets.GITHUB_TOKEN}}
jira-user: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_USER }}
jira-token: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_TOKEN }}
101 changes: 101 additions & 0 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: QA

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]

jobs:
argsInputTest:
name: >
'args' input
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run action with args
uses: ./
with:
args: -Dsonar.someArg=aValue -Dsonar.scanner.internal.dumpToFile=./output.properties
env:
SONAR_TOKEN: FAKE_TOKEN
- name: Assert
run: |
./test/assertFileContains ./output.properties "sonar.someArg=aValue"
projectBaseDirInputTest:
name: >
'projectBaseDir' input
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- run: |
mkdir -p ./baseDir
- name: Run action with projectBaseDir
uses: ./
with:
args: -Dsonar.scanner.internal.dumpToFile=./output.properties
projectBaseDir: ./baseDir
env:
SONAR_TOKEN: FAKE_TOKEN
- name: Assert
run: |
./test/assertFileContains ./output.properties "sonar.projectBaseDir=.*/baseDir"
scannerVersionTest:
name: >
'scannerVersion' input
runs-on: ubuntu-latest # assumes default RUNNER_ARCH for linux is X64
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run action with scannerVersion
uses: ./
with:
scannerVersion: 6.1.0.4477
args: -Dsonar.scanner.internal.dumpToFile=./output.properties
env:
NO_CACHE: true # force install-sonar-scanner-cli.sh execution
SONAR_HOST_URL: http://not_actually_used
SONAR_SCANNER_JSON_PARAMS: '{"sonar.scanner.internal.dumpToFile": "./output.properties"}'
- name: Assert
run: |
./test/assertFileExists "$RUNNER_TEMP/sonarscanner/sonar-scanner-cli-6.1.0.4477-linux-x64.zip"
scannerBinariesUrlTest:
name: >
'scannerBinariesUrl' input with invalid URL
runs-on: ubuntu-latest # assumes default RUNNER_ARCH for linux is X64
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run action with scannerBinariesUrl
id: runTest
uses: ./
continue-on-error: true
with:
scannerVersion: 6.2.1.4610
scannerBinariesUrl: https://invalid_uri/Distribution/sonar-scanner-cli
env:
NO_CACHE: true # force install-sonar-scanner-cli.sh execution
SONAR_HOST_URL: http://not_actually_used
SONAR_SCANNER_JSON_PARAMS: '{"sonar.scanner.internal.dumpToFile": "./output.properties"}'
- name: Fail if action succeeded
if: steps.runTest.outcome == 'success'
run: exit 1
- name: Assert Sonar Scanner CLI was not downloaded
run: |
./test/assertFileDoesntExist "$RUNNER_TEMP/sonarscanner/sonar-scanner-cli-6.2.1.4610-linux-x64.zip"
- name: Assert Sonar Scanner CLI was not executed
run: |
./test/assertFileDoesntExist ./output.properties
32 changes: 32 additions & 0 deletions .github/workflows/update-tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Update Tags

on:
push:
tags:
- v*.*.*

jobs:
generate:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Parse semver
uses: madhead/semver-utils@40bbdc6e50b258c09f35f574e83c51f60d2ce3a2 # v4.0.0
id: version
with:
version: ${{ github.ref_name }}

- name: Update tags
run: |
TAGS='v${{ steps.version.outputs.major }} v${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}'

for t in $TAGS; do
git tag -f "$t"
git push origin ":$t" 2>/dev/null || true
git push origin "$t"
done
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ ENV LC_ALL="C.UTF-8"

WORKDIR /opt

# https://help.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user
USER root

# Prepare entrypoint
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
COPY cleanup.sh /cleanup.sh
RUN chmod +x /cleanup.sh
ENTRYPOINT ["/entrypoint.sh"]

Loading
Loading