Skip to content

Commit 6dd8eba

Browse files
committed
tweak skip upload logic
1 parent 69fe0e7 commit 6dd8eba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ jobs:
3030

3131
publish-nuget-pacakge:
3232
needs: test
33-
if: (github.event_name == 'push')
3433

3534
runs-on: windows-latest
3635

@@ -54,6 +53,7 @@ jobs:
5453
path: packages/*.nupkg
5554

5655
- name: Publish the package to GPR
56+
if: (github.event_name != 'pull_request')
5757
shell: pwsh
5858
run: dotnet nuget push "$((Resolve-Path packages/*.nupkg).Path)" -s https://nuget.pkg.github.com/tocsoft/index.json -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
5959

@@ -64,7 +64,6 @@ jobs:
6464

6565
publish-npm-package:
6666
needs: test
67-
if: (github.event_name == 'push')
6867

6968
runs-on: windows-latest
7069

@@ -88,10 +87,12 @@ jobs:
8887
path: packages/*.tgz
8988

9089
- name: Configure authenticate bintray
90+
if: (github.event_name != 'pull_request')
9191
shell: pwsh
9292
run: Set-Content -Path '.npmrc' -Value "${{ secrets.BINTRAY_NPMRC }}"
9393

9494
- name: Publish npm package to bintray
95+
if: (github.event_name != 'pull_request')
9596
shell: pwsh
9697
run: npm publish "$((Resolve-Path packages/*.tgz).Path)" --registry https://api.bintray.com/npm/tocsoft/npm
9798

0 commit comments

Comments
 (0)