Skip to content

Commit 734b091

Browse files
IONOS(ci): gate */dev/* GitLab trigger behind ENABLE_REMOTE_TRIGGER_USER_DEV
The remote GitLab pipeline does not yet handle the BUILD_TYPE=dev-<prefix> payload produced for the */dev/* developer-branch class, so every push to a developer branch currently fires a remote run the consumer cannot service. Add an opt-in repository variable ENABLE_REMOTE_TRIGGER_USER_DEV which must be set to 'true' for the trigger-remote-dev-workflow job to run on */dev/* branches. The other three branch classes (ionos-dev, ionos-stable, rc/*) are unaffected and continue to trigger as before. The existing DISABLE_REMOTE_TRIGGER kill-switch keeps its current semantics and layers on top of the new opt-in. The "Check configuration" diagnostic step in prepare-matrix now prints the new variable and surfaces an explicit ❌/✅ line for */dev/* branches so the expected-outcome line ("WILL RUN" / "WILL BE SKIPPED") reflects the opt-in state. upload-to-artifactory and the ghcr image push are unchanged — */dev/* builds still land in devs/<prefix>/... in Artifactory.
1 parent 9dc5306 commit 734b091

1 file changed

Lines changed: 35 additions & 11 deletions

File tree

.github/workflows/hidrive-next-build.yml

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,31 +117,40 @@ jobs:
117117
echo "### 🔧 Remote Trigger Configuration" >> $GITHUB_STEP_SUMMARY
118118
echo "" >> $GITHUB_STEP_SUMMARY
119119
echo "**DISABLE_REMOTE_TRIGGER value:** \`${{ vars.DISABLE_REMOTE_TRIGGER }}\`" >> $GITHUB_STEP_SUMMARY
120+
echo "**ENABLE_REMOTE_TRIGGER_USER_DEV value:** \`${{ vars.ENABLE_REMOTE_TRIGGER_USER_DEV }}\`" >> $GITHUB_STEP_SUMMARY
121+
if [ "${{ vars.ENABLE_REMOTE_TRIGGER_USER_DEV }}" != "true" ]; then
122+
echo " - 💡 To enable the GitLab trigger for \`*/dev/*\` branches, set repository variable \`ENABLE_REMOTE_TRIGGER_USER_DEV\` to \`true\` at [Settings → Variables → Actions](https://github.com/${{ github.repository }}/settings/variables/actions)." >> $GITHUB_STEP_SUMMARY
123+
fi
120124
echo "**Event type:** \`${{ github.event_name }}\`" >> $GITHUB_STEP_SUMMARY
121125
echo "**Branch:** \`${{ github.ref_name }}\`" >> $GITHUB_STEP_SUMMARY
122126
echo "" >> $GITHUB_STEP_SUMMARY
123127
124128
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
125129
echo "🔧 Remote Trigger Configuration"
126130
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
127-
echo "DISABLE_REMOTE_TRIGGER = '${{ vars.DISABLE_REMOTE_TRIGGER }}'"
128-
echo "Event type = '${{ github.event_name }}'"
129-
echo "Branch = '${{ github.ref_name }}'"
131+
echo "DISABLE_REMOTE_TRIGGER = '${{ vars.DISABLE_REMOTE_TRIGGER }}'"
132+
echo "ENABLE_REMOTE_TRIGGER_USER_DEV = '${{ vars.ENABLE_REMOTE_TRIGGER_USER_DEV }}'"
133+
if [ "${{ vars.ENABLE_REMOTE_TRIGGER_USER_DEV }}" != "true" ]; then
134+
echo " 💡 To enable the GitLab trigger for '*/dev/*' branches,"
135+
echo " set repository variable ENABLE_REMOTE_TRIGGER_USER_DEV to 'true' at:"
136+
echo " https://github.com/${{ github.repository }}/settings/variables/actions"
137+
fi
138+
echo "Event type = '${{ github.event_name }}'"
139+
echo "Branch = '${{ github.ref_name }}'"
130140
echo ""
131141
132142
if [ "${{ vars.DISABLE_REMOTE_TRIGGER }}" == "true" ]; then
133-
echo "⚠️ Remote trigger is DISABLED"
143+
echo "⚠️ DISABLE_REMOTE_TRIGGER='true' — remote trigger is force-disabled"
134144
echo " The 'trigger-remote-dev-workflow' job will be SKIPPED"
135-
echo "**Status:** ⚠️ Remote trigger is **DISABLED**" >> $GITHUB_STEP_SUMMARY
145+
echo "**Status:** ⚠️ Remote trigger is **force-disabled** via \`DISABLE_REMOTE_TRIGGER='true'\`" >> $GITHUB_STEP_SUMMARY
136146
echo "" >> $GITHUB_STEP_SUMMARY
137147
echo "The \`trigger-remote-dev-workflow\` job will be skipped." >> $GITHUB_STEP_SUMMARY
138148
echo "" >> $GITHUB_STEP_SUMMARY
139149
echo "To enable, delete the variable or set it to a value other than 'true' at:" >> $GITHUB_STEP_SUMMARY
140150
echo "https://github.com/${{ github.repository }}/settings/variables/actions" >> $GITHUB_STEP_SUMMARY
141151
else
142-
echo "✅ Remote trigger is ENABLED"
143-
echo " Checking if trigger conditions are met..."
144-
echo "**Status:** ✅ Remote trigger is **ENABLED**" >> $GITHUB_STEP_SUMMARY
152+
echo "ℹ️ DISABLE_REMOTE_TRIGGER not set — checking trigger conditions..."
153+
echo "**Status:** \`DISABLE_REMOTE_TRIGGER\` not set — actual outcome determined by conditions below." >> $GITHUB_STEP_SUMMARY
145154
echo "" >> $GITHUB_STEP_SUMMARY
146155
147156
WILL_TRIGGER=true
@@ -158,6 +167,7 @@ jobs:
158167
fi
159168
160169
VALID_BRANCH_PATTERN='^(ionos-dev|ionos-stable)$|^rc/.*$|^[^/]+/dev/.*$'
170+
USER_DEV_PATTERN='^[^/]+/dev/.*$'
161171
if [[ ! "${{ github.ref_name }}" =~ $VALID_BRANCH_PATTERN ]]; then
162172
echo "- ❌ Branch must be 'ionos-dev', 'ionos-stable', 'rc/*' or '*/dev/*' (current: \`${{ github.ref_name }}\`)" >> $GITHUB_STEP_SUMMARY
163173
echo " ❌ Branch is '${{ github.ref_name }}' (must be 'ionos-dev', 'ionos-stable', 'rc/*' or '*/dev/*')"
@@ -167,6 +177,17 @@ jobs:
167177
echo " ✅ Branch is '${{ github.ref_name }}'"
168178
fi
169179
180+
if [[ "${{ github.ref_name }}" =~ $USER_DEV_PATTERN ]]; then
181+
if [ "${{ vars.ENABLE_REMOTE_TRIGGER_USER_DEV }}" == "true" ]; then
182+
echo "- ✅ User-dev branch opt-in (\`ENABLE_REMOTE_TRIGGER_USER_DEV='true'\`)" >> $GITHUB_STEP_SUMMARY
183+
echo " ✅ ENABLE_REMOTE_TRIGGER_USER_DEV='true' — '*/dev/*' trigger is opted in"
184+
else
185+
echo "- ❌ User-dev branch requires \`ENABLE_REMOTE_TRIGGER_USER_DEV='true'\` (current: \`${{ vars.ENABLE_REMOTE_TRIGGER_USER_DEV }}\`)" >> $GITHUB_STEP_SUMMARY
186+
echo " ❌ '*/dev/*' branch requires ENABLE_REMOTE_TRIGGER_USER_DEV='true' (current: '${{ vars.ENABLE_REMOTE_TRIGGER_USER_DEV }}')"
187+
WILL_TRIGGER=false
188+
fi
189+
fi
190+
170191
echo "- ℹ️ All dependent jobs must succeed (checked at job runtime)" >> $GITHUB_STEP_SUMMARY
171192
echo "" >> $GITHUB_STEP_SUMMARY
172193
@@ -901,13 +922,16 @@ jobs:
901922
name: Trigger remote workflow
902923
needs: [ hidrive-next-build, upload-to-artifactory ]
903924
# Trigger remote build on "ionos-dev|ionos-stable|rc/*|*/dev/*" branch *push* defined in on:push:branches
904-
# Can be disabled via repository variable 'DISABLE_REMOTE_TRIGGER' (set to 'true' to disable)
925+
# Can be disabled entirely via repository variable 'DISABLE_REMOTE_TRIGGER' (set to 'true' to disable)
926+
# The "*/dev/*" branch class is gated by repository variable 'ENABLE_REMOTE_TRIGGER_USER_DEV'
927+
# (default off — set to 'true' to enable once GitLab supports BUILD_TYPE=dev-<prefix>)
905928
# Configure at: https://github.com/IONOS-Productivity/nc-server/settings/variables/actions
906929
if: |
907930
always() &&
908931
github.event_name == 'push' &&
909932
(github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable' ||
910-
startsWith(github.ref_name, 'rc/') || contains(github.ref_name, '/dev/')) &&
933+
startsWith(github.ref_name, 'rc/') ||
934+
(contains(github.ref_name, '/dev/') && vars.ENABLE_REMOTE_TRIGGER_USER_DEV == 'true')) &&
911935
needs.hidrive-next-build.result == 'success' &&
912936
needs.upload-to-artifactory.result == 'success' &&
913937
vars.DISABLE_REMOTE_TRIGGER != 'true'
@@ -973,7 +997,7 @@ jobs:
973997
# | ionos-dev | main | dev |
974998
# | ionos-stable | main | stable |
975999
# | rc/* | main | rc |
976-
# | */dev/* | main | dev-<branch-pfx> |
1000+
# | */dev/* | main | dev-<branch-pfx> | (opt-in via ENABLE_REMOTE_TRIGGER_USER_DEV)
9771001
9781002
BUILD_TYPE="dev"
9791003

0 commit comments

Comments
 (0)