Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanfbrito committed Aug 21, 2024
1 parent 84787a4 commit 521daae
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions .github/workflows/pull-request-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 521daae

Please sign in to comment.