【发布时间】:2021-02-15 18:16:51
【问题描述】:
我有一个需要在推送或拉取请求上执行的工作流,除了将包推送到 NuGet 的最后一步(我不希望这发生在拉取请求上,即使是掌握) .
如果工作流是从拉取请求触发的,我如何防止“发布 NuGet”步骤运行?
name: .NET Core
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
- name: Publish NuGet
uses: brandedoutcast/publish-nuget@v2.5.2
with:
PROJECT_FILE_PATH: "Orleans.Sagas/Orleans.Sagas.csproj"
NUGET_KEY: ${{secrets.NUGET_KEY}}
【问题讨论】:
标签: github-actions