Skip to content

Commit

Permalink
Merge pull request #87 from Sergio0694/dev/skip-repeated-pr-ci-runs
Browse files Browse the repository at this point in the history
Skip unnecessary CI runs for PRs from same user
  • Loading branch information
Sergio0694 authored Oct 28, 2023
2 parents cb09ceb + 353548c commit 7e367d3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
name: .NET

# This workflow should trigger in the following cases:
# - The commit is any push in any branch in the repo
# - The commit is a published PR from anyone else
#
# This setup is done to avoid duplicate runs for the same exact commits, for cases when
# the PR is done from a branch in this repo, which would already trigger the "push"
# condition. This way, only PRs from forks will actually trigger the workflow.
#
# Because we can't really check these conditions from the global triggers here, they are
# added to the two root jobs below instead. If canceled, the whole workflow will stop.
on: [push, pull_request]

env:
Expand All @@ -10,6 +20,9 @@ jobs:

# Build the whole PolySharp solution
build-solution:
if: >-
github.event_name == 'push' ||
github.event.pull_request.user.login != github.repository_owner
strategy:
matrix:
configuration: [Debug, Release]
Expand Down Expand Up @@ -39,6 +52,9 @@ jobs:

# Build the .msbuildproj projects to generate all the NuGet packages
build-packages:
if: >-
github.event_name == 'push' ||
github.event.pull_request.user.login != github.repository_owner
runs-on: windows-2022
steps:
- name: Git checkout
Expand Down

0 comments on commit 7e367d3

Please sign in to comment.