Skip to content

Commit ec2188d

Browse files
committed
Improve PARENT_BRANCH detection for pull request compatibility in CI workflow
1 parent 42e60f7 commit ec2188d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/workflows/maven.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ jobs:
1818
build:
1919
runs-on: macos-14
2020
env:
21-
PARENT_BRANCH: ${{ github.ref_name == 'master' && 'main' || github.ref_name }}
21+
PARENT_BRANCH: ${{
22+
github.event_name == 'pull_request' && github.event.pull_request.base.ref
23+
|| (github.ref_name == 'master' && 'main')
24+
|| github.ref_name
25+
}}
2226
timeout-minutes: 15
2327
steps:
2428
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)