File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -91,17 +91,24 @@ jobs:
91
91
BRANCH_NAME="${{ steps.version.outputs.branch-name }}"
92
92
EVENT="${{ github.event_name }}"
93
93
94
- # Publish on push events (feature branches → snapshots, stable branches → releases)
95
- if [[ "$EVENT" == "push" ]]; then
94
+ echo "🔍 Event: $EVENT"
95
+ echo "🔍 GitHub ref: ${{ github.ref }}"
96
+ echo "🔍 Branch name: $BRANCH_NAME"
97
+
98
+ # Publish on push events, workflow_dispatch, OR pull_request (for snapshots only)
99
+ if [[ "$EVENT" == "push" ]] || [[ "$EVENT" == "workflow_dispatch" ]]; then
96
100
echo "should-publish=true" >> $GITHUB_OUTPUT
97
101
if [[ "${{ steps.version.outputs.is-snapshot }}" == "true" ]]; then
98
102
echo "✅ Will publish feature snapshot to GitHub Packages"
99
103
else
100
104
echo "✅ Will publish release to GitHub Packages + Maven Central"
101
105
fi
106
+ elif [[ "$EVENT" == "pull_request" ]] && [[ "${{ steps.version.outputs.is-snapshot }}" == "true" ]]; then
107
+ echo "should-publish=true" >> $GITHUB_OUTPUT
108
+ echo "✅ Will publish PR snapshot to GitHub Packages for testing"
102
109
else
103
110
echo "should-publish=false" >> $GITHUB_OUTPUT
104
- echo "ℹ️ PR : Build only, no publishing"
111
+ echo "ℹ️ Event '$EVENT' : Build only, no publishing"
105
112
fi
106
113
107
114
- name : Build & Test
You can’t perform that action at this time.
0 commit comments