diff --git a/.github/workflows/pull-request-kotlin.yml b/.github/workflows/pull-request-kotlin.yml index 3e29803..776a32d 100644 --- a/.github/workflows/pull-request-kotlin.yml +++ b/.github/workflows/pull-request-kotlin.yml @@ -195,6 +195,7 @@ jobs: # needs to join the tailnet before the scan step can reach it. Skipped # automatically for repos still on SonarCloud (no TAILSCALE_AUTHKEY passed). - name: Tailscale + id: tailscale if: ${{ !inputs.skip-sonar && env.TAILSCALE_AUTHKEY != '' }} continue-on-error: ${{ inputs.sonar-non-blocking }} uses: tailscale/github-action@6cae46e2d796f265265cfcf628b72a32b4d7cade # v3.3.0 @@ -202,8 +203,9 @@ jobs: authkey: ${{ env.TAILSCALE_AUTHKEY }} hostname: "github-${{ github.run_id }}" args: "--login-server https://headscale.monta.com --accept-routes" + # != 'failure' (not == 'success') keeps the SonarCloud path when Tailscale is skipped. - name: Upload results to SonarQube - if: ${{ !inputs.skip-sonar }} + if: ${{ !inputs.skip-sonar && steps.tailscale.outcome != 'failure' }} continue-on-error: ${{ inputs.sonar-non-blocking }} env: GHL_USERNAME: ${{ secrets.GHL_USERNAME }} diff --git a/.github/workflows/sonar-cloud.yml b/.github/workflows/sonar-cloud.yml index 9aa4e2a..d48af03 100644 --- a/.github/workflows/sonar-cloud.yml +++ b/.github/workflows/sonar-cloud.yml @@ -101,6 +101,7 @@ jobs: # needs to join the tailnet before the scan step can reach it. Skipped # automatically for repos still on SonarCloud (no TAILSCALE_AUTHKEY passed). - name: Tailscale + id: tailscale if: ${{ env.TAILSCALE_AUTHKEY != '' }} continue-on-error: ${{ inputs.sonar-non-blocking }} uses: tailscale/github-action@6cae46e2d796f265265cfcf628b72a32b4d7cade # v3.3.0 @@ -117,7 +118,9 @@ jobs: gradle-module: ${{ inputs.gradle-module }} gradle-tasks: 'test koverXmlReport' gradle-args: ${{ inputs.gradle-args }} + # != 'failure' (not == 'success') keeps the SonarCloud path when Tailscale is skipped. - name: Analyze with SonarQube + if: ${{ steps.tailscale.outcome != 'failure' }} continue-on-error: ${{ inputs.sonar-non-blocking }} env: GHL_USERNAME: ${{ secrets.GHL_USERNAME }}