From e7cdadcb0a9c5a14e7cd86af72caa53daf19f5d0 Mon Sep 17 00:00:00 2001 From: Karel Maxa Date: Thu, 12 Nov 2026 08:47:45 +0100 Subject: [PATCH] Perform Sonar analysis only on main branch --- .github/workflows/build-project.yml | 16 ++++++++----- .github/workflows/sonar-trigger.yml | 35 ----------------------------- pom.xml | 4 ++++ 3 files changed, 14 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/sonar-trigger.yml diff --git a/.github/workflows/build-project.yml b/.github/workflows/build-project.yml index 2f3768e2..09c57951 100644 --- a/.github/workflows/build-project.yml +++ b/.github/workflows/build-project.yml @@ -16,9 +16,9 @@ jobs: name: "Java ${{ matrix.java }} build" steps: - name: Checkout project - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Set up Java - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 + uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1 with: distribution: "temurin" java-version: "${{ matrix.java }}" @@ -27,8 +27,12 @@ jobs: run: mvn -B verify sonar: needs: build - if: github.base_ref == 'main' && github.event_name == 'pull_request' - name: Prepare analysis context - uses: WrenSecurity/.github/.github/workflows/sonar-pull-prepare.yml@main + if: github.repository_owner == 'WrenSecurity' && github.event_name == 'push' && github.ref == 'refs/heads/main' + name: Sonar analysis + uses: WrenSecurity/.github/.github/workflows/sonar-maven.yml@main with: - pull_request: ${{ toJSON(github.event.pull_request) }} \ No newline at end of file + commit_sha: ${{ github.sha }} + java_version: 17 + project_key: 'WrenSecurity_wrenicf-java-framework' + secrets: + sonar_token: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/sonar-trigger.yml b/.github/workflows/sonar-trigger.yml deleted file mode 100644 index ec68e767..00000000 --- a/.github/workflows/sonar-trigger.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Trigger Sonar analysis - -on: - workflow_run: - workflows: - - Build project - types: - - completed - -concurrency: - group: trigger-sonar-${{ github.event.workflow_run.head_branch }} - cancel-in-progress: true - -permissions: - contents: read - -jobs: - prepare: - if: github.event.workflow_run.conclusion == 'success' - uses: WrenSecurity/.github/.github/workflows/sonar-prepare.yml@main - name: Prepare analysis context - with: - workflow_run: ${{ toJSON(github.event.workflow_run) }} - trigger: - needs: prepare - if: needs.prepare.outputs.sonar_allowed - name: Trigger Sonar analysis - uses: WrenSecurity/.github/.github/workflows/sonar-maven.yml@main - with: - commit_sha: ${{ github.event.workflow_run.head_sha }} - java_version: 17 - project_key: 'WrenSecurity_wrenicf-java-framework' - pull_request: ${{ needs.prepare.outputs.pull_request }} - secrets: - sonar_token: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 79360132..65660f3c 100644 --- a/pom.xml +++ b/pom.xml @@ -104,6 +104,10 @@ https://github.com/WrenSecurity/wrenicf-java-framework/issues + + wrenicf-java-framework + + framework-license