Skip to content

Commit be543c0

Browse files
committed
Enable Sonar scan as a GitHub Action
1 parent 11a7170 commit be543c0

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

.github/workflows/create-release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) 2023, Oracle and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
#
14
name: Create Release
25
run-name: Creating draft release for ${{ github.ref_name }}
36

.github/workflows/sonar-branch.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (c) 2023, Oracle and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
#
4+
name: Sonar Scan
5+
6+
on:
7+
push:
8+
branches:
9+
- 'main'
10+
- 'develop*'
11+
12+
jobs:
13+
sonar_scan:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
- name: Setup JDK 11
20+
uses: actions/setup-java@v3
21+
with:
22+
distribution: 'oracle'
23+
java-version: 11
24+
- name: Sonar Scan
25+
run: |
26+
mvn -B sonar:sonar \
27+
-Dsonar.branch.name=main
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<properties>
3434
<sonar.organization>oracle</sonar.organization>
3535
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
36+
<sonar.projectKey>oracle_weblogic-image-tool</sonar.projectKey>
3637

3738
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3839
<maven.compiler.source>1.8</maven.compiler.source>

0 commit comments

Comments
 (0)