diff --git a/.github/workflows/conf-build-test.yml b/.github/workflows/conf-build-test.yml index 4661ece..f42376c 100644 --- a/.github/workflows/conf-build-test.yml +++ b/.github/workflows/conf-build-test.yml @@ -64,11 +64,15 @@ jobs: echo "${{ github.event.pull_request.head.sha }}" > ${{ runner.temp }}/common/pr-head-sha - name: Upload linux artifact + id: upload_build uses: actions/upload-artifact@v4 with: name: linux path: build/default-develop/packages-default-develop/* + - name: Save artifact URL to file + run: echo "${{ steps.upload_build.outputs.artifact-url }}" > ${{ runner.temp }}/common/artifact_url.txt + - name: Upload common artifact uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/post-build-artifacts.yml b/.github/workflows/post-build-artifacts.yml new file mode 100644 index 0000000..17464f1 --- /dev/null +++ b/.github/workflows/post-build-artifacts.yml @@ -0,0 +1,49 @@ +name: Lint and Comment on PR + +on: + workflow_run: + workflows: [push-build-test-lint-release] + types: + - completed + +jobs: + comment: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-latest + permissions: + actions: read + pull-requests: write + + steps: + - name: 'Download common artifact' + uses: actions/download-artifact@v4 + with: + name: common + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} + path: ${{ runner.temp }} + + - name: Build PR comment + id: build_comment + working-directory: ${{ runner.temp }} + run: | + echo "🧩 Build Artifacts" > comment.md + echo "" >> comment.md + echo "✅ The following build artifacts were produced:" >> comment.md + echo "" >> comment.md + url=$(cat artifact_url.txt) + echo "- [**${{ runner.name }}**](${url})" >> comment.md + echo "" >> comment.md + + - name: Read PR variables + id: getprv + working-directory: ${{ runner.temp }} + run: | + echo "prn=$(cat pr_number)" >> $GITHUB_OUTPUT + + - name: Post or update PR comment + uses: peter-evans/create-or-update-comment@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ steps.getprv.outputs.prn }} + body-path: ${{ runner.temp }}/comment.md