Skip to content

Commit a9fdaab

Browse files
Exclude pushing packages to PR feed if from a fork (won't have secret)
1 parent af31915 commit a9fdaab

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ jobs:
158158
run: ./PackEachExperiment.ps1 -date ${{ env.VERSION_DATE }} -postfix ${{ env.VERSION_PROPERTY }}
159159

160160
# Push Pull Request Packages to our DevOps Artifacts Feed (see nuget.config)
161-
- name: Push Pull Request Packages
162-
if: ${{ env.IS_PR == 'true' }}
161+
- name: Push Pull Request Packages (if not fork)
162+
if: ${{ env.IS_PR == 'true' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }}
163163
run: |
164164
dotnet nuget add source https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-PullRequests/nuget/v3/index.json `
165165
--name PullRequests `
@@ -232,10 +232,10 @@ jobs:
232232
path: |
233233
${{ github.workspace }}/.github/workflows/SignClientFileList.txt
234234
235-
# if we're not doing a PR build then we upload our packages so we can sign as a separate job.
235+
# if we're not doing a PR build (or it's a PR from a fork) then we upload our packages so we can sign as a separate job or have available to test.
236236
- name: Upload Packages as Artifacts
237237
uses: actions/upload-artifact@v3
238-
if: ${{ env.IS_PR == 'false' }}
238+
if: ${{ env.IS_PR == 'false' || github.event.pull_request.head.repo.full_name != github.repository }}
239239
with:
240240
name: nuget-packages-${{ matrix.platform }}
241241
if-no-files-found: error

0 commit comments

Comments
 (0)