mumrah commented on code in PR #17140:
URL: https://github.com/apache/kafka/pull/17140#discussion_r1750710888
##########
.github/workflows/ci-complete.yml:
##########
@@ -44,11 +60,48 @@ jobs:
with:
java-version: ${{ matrix.java }}
develocity-access-key: ${{ secrets.GE_ACCESS_TOKEN }}
- - uses: actions/download-artifact@v4
+ - name: Download build scan archive
+ id: download-build-scan
+ uses: actions/download-artifact@v4
+ continue-on-error: true
with:
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
name: build-scan-test-${{ matrix.java }}
- path: ~/.gradle/build-scan-data
- - name: Publish scan
- run: ./gradlew --info buildScanPublishPrevious
+ path: ~/.gradle/build-scan-data # This is where Gradle buffers
unpublished build scan data when --no-scan is given
+ - name: Handle missing scan
+ if: ${{ steps.download-build-scan.outcome == 'failure' }}
+ run: |
+ echo "Could not download build scans from ${{
github.event.workflow_run.html_url }} " >> $GITHUB_STEP_SUMMARY
+ - name: Publish Scan
+ id: publish-build-scan
+ continue-on-error: true
+ if: ${{ steps.download-build-scan.outcome == 'success' }}
+ run: |
+ ./gradlew --info buildScanPublishPrevious > gradle.out
+ SCAN_URL=$(grep '^https://.*$' gradle.out)
+ cat gradle.out
+ echo "Published build scan to $SCAN_URL"
+ echo "build-scan-url=$SCAN_URL" >> $GITHUB_OUTPUT
+ - name: Handle failed publish
+ if: ${{ steps.publish-build-scan.outcome == 'failure' }}
+ uses: ./.github/actions/gh-api-update-status
+ with:
+ gh-token: ${{ secrets.GITHUB_TOKEN }}
+ repository: ${{ github.event.workflow_run.head_repository.full_name
}}
+ commit_sha: ${{ github.event.workflow_run.head_sha }}
+ url: '${{ github.event.repository.html_url }}/actions/runs/${{
github.run_id }}'
Review Comment:
A good question. I originally had the API call here directly, but decided it
might be useful for other custom status checks we might eventually want. I also
tried it as a bash script, but realized a composite action is more reusable.
Aesthetically speaking, the composite action looks nicer IMO. The API call
itself is a multi-line bash command with headers and such. It's not as pretty
looking at the `with` block of a composite action 😄
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]