From 521daaea63a752ee42b9d503e762466ebe583905 Mon Sep 17 00:00:00 2001 From: Jean Brito Date: Wed, 21 Aug 2024 17:04:22 -0300 Subject: [PATCH] a --- .github/workflows/pull-request-build.yml | 31 +++++++++++------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/pull-request-build.yml b/.github/workflows/pull-request-build.yml index 54c95c16a..2a931523d 100644 --- a/.github/workflows/pull-request-build.yml +++ b/.github/workflows/pull-request-build.yml @@ -117,45 +117,42 @@ jobs: - name: Generate Artifact Links (Linux/macOS) if: runner.os != 'Windows' - id: generate-links-unix run: | if [ -n "${{ steps.get-artifact-url.outputs.artifact_url }}" ]; then echo "### Artifacts for ${{ matrix.os }}" > artifact-links.md echo "- [${{ runner.os }} Artifacts](${{ steps.get-artifact-url.outputs.artifact_url }})" >> artifact-links.md - echo "artifact_url=${{ steps.get-artifact-url.outputs.artifact_url }}" >> $GITHUB_ENV fi shell: bash - name: Generate Artifact Links (Windows) if: runner.os == 'Windows' - id: generate-links-windows run: | if ($env:STEPS_GET_ARTIFACT_URL_OUTPUTS_ARTIFACT_URL -ne '') { "### Artifacts for $env:MATRIX_OS" | Out-File -FilePath artifact-links.md "- [$env:RUNNER_OS Artifacts]($env:STEPS_GET_ARTIFACT_URL_OUTPUTS_ARTIFACT_URL)" | Out-File -FilePath artifact-links.md -Append - echo "artifact_url=$($env:STEPS_GET_ARTIFACT_URL_OUTPUTS_ARTIFACT_URL)" | Out-File -FilePath $env:GITHUB_ENV -Append } shell: pwsh - - name: Debug - Print GITHUB_ENV Content (Windows) - if: runner.os == 'Windows' - run: | - Write-Host "Contents of GITHUB_ENV:" - Get-Content $env:GITHUB_ENV - shell: pwsh + - name: Post PR Comment with the Artifact link (Linux/macOS) + if: runner.os != 'Windows' + uses: marocchino/sticky-pull-request-comment@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + path: artifact-links.md + header: '### Artifact for ${{ matrix.os }}' + recreate: true + append: false - - name: Debug - Check artifact_url (Windows) + - name: Post PR Comment with the Artifact link (Windows) if: runner.os == 'Windows' run: | - Write-Host "artifact_url=$env:artifact_url" - shell: pwsh - - - name: Post PR Comment with the Artifact link (Linux/macOS) - if: env.artifact_url != '' + if (Test-Path -Path "artifact-links.md") { + Write-Host "artifact-links.md exists, posting comment..." + } uses: marocchino/sticky-pull-request-comment@v2 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} path: artifact-links.md - header: '### Artifact for ${{ matrix.os }}' + header: '### Artifact for Windows' recreate: true append: false