Skip to content

Commit a2c8773

Browse files
committed
Update CI workflow branch triggers and events
Refines workflow triggers to run on push and pull request events only for main, dev/*, and rel/* branches. Adds workflow_dispatch and merge_group events for manual and grouped runs, and removes redundant job-level event checks.
1 parent 16df4a3 commit a2c8773

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

.github/workflows/ci-build.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1+
# https://docs.github.com/actions/using-workflows/about-workflows
2+
# https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions
3+
14
name: CI-build
25

3-
# This workflow should trigger in the following cases:
4-
# - The commit is any push in any branch in the repo
5-
# - The commit is a published PR from anyone else
6-
#
7-
# This setup is done to avoid duplicate runs for the same exact commits, for cases when
8-
# the PR is done from a branch in this repo, which would already trigger the "push"
9-
# condition. This way, only PRs from forks will actually trigger the workflow.
10-
#
11-
# Because we can't really check these conditions from the global triggers here, they are
12-
# added to the two root jobs below instead. If canceled, the whole workflow will stop.
13-
on: [push, pull_request]
6+
# Controls when the action will run.
7+
on:
8+
9+
# Triggers the workflow on push or PR events, but only for the 'main', development, or release branches
10+
push:
11+
branches: [ main, 'dev/*', 'rel/*' ]
12+
pull_request:
13+
branches: [ main, 'dev/*' ]
14+
15+
# Allows running this workflow manually from the 'Actions' tab
16+
workflow_dispatch:
17+
merge_group:
1418

1519
env:
1620
IS_MAIN: ${{ github.ref == 'refs/heads/main' }}
@@ -21,9 +25,6 @@ jobs:
2125

2226
# Build the solution, run all tests, push packages to the PR feed
2327
build-and-test:
24-
if: >-
25-
github.event_name == 'push' ||
26-
github.event.pull_request.user.login != github.repository_owner
2728
strategy:
2829
matrix:
2930
configuration: [Debug, Release]

0 commit comments

Comments
 (0)