Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ jobs:

- name: Upload build logs
if: ${{ always() }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: ${{ matrix.rid }}-build-logs
path: |
Comment on lines 209 to 215
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: actions/[email protected] requires unique artifact names across jobs. name: ${{ github.sha }} in a matrix job is not unique and will fail if multiple jobs attempt to upload.
Severity: HIGH | Confidence: 0.95

🔍 Detailed Analysis

The actions/[email protected] action requires artifact names to be unique across all jobs in a workflow run. In .github/workflows/build.yml, the "Archive NuGet Packages" step at line 240 uses name: ${{ github.sha }} for its artifact. Since github.sha is constant across matrix iterations, multiple matrix jobs would attempt to upload to the same artifact name if the if: runner.os == 'macOS' condition were not present or changed. This would cause the workflow step to fail, as v5.0.0 errors when attempting to create an artifact with a name already in use.

💡 Suggested Fix

Modify the artifact name at .github/workflows/build.yml:240 to include a unique identifier per matrix job, such as name: ${{ github.sha }}-${{ matrix.rid }}.

🤖 Prompt for AI Agent
Fix this bug. In .github/workflows/build.yml at lines 209-215: The
`actions/[email protected]` action requires artifact names to be unique across all
jobs in a workflow run. In `.github/workflows/build.yml`, the "Archive NuGet Packages"
step at line 240 uses `name: ${{ github.sha }}` for its artifact. Since `github.sha` is
constant across matrix iterations, multiple matrix jobs would attempt to upload to the
same artifact name if the `if: runner.os == 'macOS'` condition were not present or
changed. This would cause the workflow step to fail, as v5.0.0 errors when attempting to
create an artifact with a name already in use.

Did we get this right? 👍 / 👎 to inform future reviews.

Expand All @@ -227,7 +227,7 @@ jobs:

- name: Upload build and test outputs
if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: ${{ matrix.rid }}-verify-test-results
path: "**/*.received.*"
Expand All @@ -237,7 +237,7 @@ jobs:

- name: Archive NuGet Packages
if: env.CI_PUBLISHING_BUILD == 'true'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: ${{ github.sha }}
if-no-files-found: error
Expand Down Expand Up @@ -307,7 +307,7 @@ jobs:

- name: Upload logs
if: ${{ always() }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: ${{ runner.os }}-msbuild-logs
path: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/device-tests-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

- name: Upload Android Test App (net9.0)
if: matrix.tfm == 'net9.0'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: device-test-android-net9.0
if-no-files-found: error
Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:

- name: Upload results
if: success() || failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: device-test-android-${{ matrix.api-level }}-${{ matrix.tfm }}-results
path: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/device-tests-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

- name: Upload results
if: success() || failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: device-test-ios-results
path: |
Expand Down
Loading