diff --git a/.github/workflows/javadoc-publication.yaml b/.github/workflows/javadoc-publication.yaml index 6c2726ba..566fc005 100644 --- a/.github/workflows/javadoc-publication.yaml +++ b/.github/workflows/javadoc-publication.yaml @@ -66,12 +66,20 @@ jobs: uses: SonarSource/jfrog-setup-wrapper@58546d2106f9d38c37590b7f125f85b0d1fa4cee # 3.5.0 with: jfrogAccessToken: ${{ fromJSON(steps.secrets.outputs.vault).artifactory_access_token }} + - name: Create a path filter from the groupId for artifactory build search + id: filter + run: | + jfrog rt curl -X GET "/api/build/${{ github.event.repository.name }}/${{ steps.get_version.outputs.build }}" > build-info.json + groupIdPath=$(jq -r '.buildInfo.modules[0].id' build-info.json | cut -d':' -f1 | tr '.' '/') + echo "path: $groupIdPath" + echo "groupIdPath=${groupIdPath}" >> $GITHUB_OUTPUT - name: Download Artifacts uses: SonarSource/gh-action_release/download-build@master with: flat-download: true build-number: ${{ steps.get_version.outputs.build }} local-repo-dir: ${{ steps.local_repo.outputs.dir }} + filter: ${{ steps.filter.outputs.groupIdPath }} remote-repo: ${{ inputs.publicRelease == true && 'sonarsource-public-releases' || 'sonarsource-private-releases'}} - name: Keep only javadoc.jar run: find ${{ steps.local_repo.outputs.dir }} -type f ! -name "*-javadoc.jar" -delete diff --git a/download-build/action.yml b/download-build/action.yml index 2bef7e40..772b992a 100644 --- a/download-build/action.yml +++ b/download-build/action.yml @@ -16,6 +16,10 @@ inputs: build-number: description: 'Build number' required: true + filter: + description: 'Path to the artifacts to download' + required: false + default: '' exclusions: description: 'Exclude pattern from downloaded files' required: false @@ -61,10 +65,16 @@ runs: JFROG_DL_BUILD: ${{ github.event.repository.name }}/${{ inputs.build-number }} JFROG_DL_EXCLUSIONS: ${{ inputs.exclusions }} JFROG_DL_REMOTE_REPO: ${{ inputs.remote-repo }} - run: jfrog rt download - --fail-no-op ${{ steps.define-download-options.outputs.jfrog_dl_options }} - --build "${JFROG_DL_BUILD}" - "${JFROG_DL_REMOTE_REPO}" + FILTER: ${{ inputs.filter }} + run: | + if [ -n "$FILTER" ]; then + JFROG_DL_REMOTE_REPO="${JFROG_DL_REMOTE_REPO}/$FILTER/" + fi + echo "$JFROG_DL_REMOTE_REPO" + jfrog rt download \ + --fail-no-op ${{ steps.define-download-options.outputs.jfrog_dl_options }} \ + --build "${JFROG_DL_BUILD}" \ + "${JFROG_DL_REMOTE_REPO}" - name: Download checksums if: ${{ inputs.dryRun != 'true' && inputs.download-checksums == 'true' }} shell: bash