Skip to content

Commit 3e20f0d

Browse files
committed
Skip CI build for PRs from repository owner
Added a condition to the build-and-test job to prevent CI from running twice for pull requests created by the repository owner. The workflow now checks the PR author and skips the job if the user is 'sergio0694', ensuring the workflow only runs once per commit.
1 parent 1768df1 commit 3e20f0d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/ci-build.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,15 @@ env:
2323

2424
jobs:
2525

26-
# Build the solution, run all tests, push packages to the PR feed
26+
# Build the solution, run all tests, push packages to the PR feed.
27+
# We want to avoid the CI being triggered twice for PRs from the
28+
# repository owner, however the repo is now under 'CommunityToolkit'.
29+
# So we just hardcode the username and skip this job for PR triggers
30+
# from that user. This ensures the workflow only runs once per commit.
2731
build-and-test:
32+
if: >-
33+
github.event_name == 'push' ||
34+
github.event.pull_request.user.login != 'sergio0694'
2835
strategy:
2936
matrix:
3037
configuration: [Debug, Release]

0 commit comments

Comments
 (0)