Skip to content

Commit 142c098

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 142c098

1 file changed

Lines changed: 31 additions & 6 deletions

File tree

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

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,26 @@ 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
@@ -158,6 +168,7 @@ jobs:
158168
fi
159169
160170
VALID_BRANCH_PATTERN='^(ionos-dev|ionos-stable)$|^rc/.*$|^[^/]+/dev/.*$'
171+
USER_DEV_PATTERN='^[^/]+/dev/.*$'
161172
if [[ ! "${{ github.ref_name }}" =~ $VALID_BRANCH_PATTERN ]]; then
162173
echo "- ❌ Branch must be 'ionos-dev', 'ionos-stable', 'rc/*' or '*/dev/*' (current: \`${{ github.ref_name }}\`)" >> $GITHUB_STEP_SUMMARY
163174
echo " ❌ Branch is '${{ github.ref_name }}' (must be 'ionos-dev', 'ionos-stable', 'rc/*' or '*/dev/*')"
@@ -167,6 +178,17 @@ jobs:
167178
echo " ✅ Branch is '${{ github.ref_name }}'"
168179
fi
169180
181+
if [[ "${{ github.ref_name }}" =~ $USER_DEV_PATTERN ]]; then
182+
if [ "${{ vars.ENABLE_REMOTE_TRIGGER_USER_DEV }}" == "true" ]; then
183+
echo "- ✅ User-dev branch opt-in (\`ENABLE_REMOTE_TRIGGER_USER_DEV='true'\`)" >> $GITHUB_STEP_SUMMARY
184+
echo " ✅ ENABLE_REMOTE_TRIGGER_USER_DEV='true' — '*/dev/*' trigger is opted in"
185+
else
186+
echo "- ❌ User-dev branch requires \`ENABLE_REMOTE_TRIGGER_USER_DEV='true'\` (current: \`${{ vars.ENABLE_REMOTE_TRIGGER_USER_DEV }}\`)" >> $GITHUB_STEP_SUMMARY
187+
echo " ❌ '*/dev/*' branch requires ENABLE_REMOTE_TRIGGER_USER_DEV='true' (current: '${{ vars.ENABLE_REMOTE_TRIGGER_USER_DEV }}')"
188+
WILL_TRIGGER=false
189+
fi
190+
fi
191+
170192
echo "- ℹ️ All dependent jobs must succeed (checked at job runtime)" >> $GITHUB_STEP_SUMMARY
171193
echo "" >> $GITHUB_STEP_SUMMARY
172194
@@ -901,13 +923,16 @@ jobs:
901923
name: Trigger remote workflow
902924
needs: [ hidrive-next-build, upload-to-artifactory ]
903925
# 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)
926+
# Can be disabled entirely via repository variable 'DISABLE_REMOTE_TRIGGER' (set to 'true' to disable)
927+
# The "*/dev/*" branch class is gated by repository variable 'ENABLE_REMOTE_TRIGGER_USER_DEV'
928+
# (default off — set to 'true' to enable once GitLab supports BUILD_TYPE=dev-<prefix>)
905929
# Configure at: https://github.com/IONOS-Productivity/nc-server/settings/variables/actions
906930
if: |
907931
always() &&
908932
github.event_name == 'push' &&
909933
(github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable' ||
910-
startsWith(github.ref_name, 'rc/') || contains(github.ref_name, '/dev/')) &&
934+
startsWith(github.ref_name, 'rc/') ||
935+
(contains(github.ref_name, '/dev/') && vars.ENABLE_REMOTE_TRIGGER_USER_DEV == 'true')) &&
911936
needs.hidrive-next-build.result == 'success' &&
912937
needs.upload-to-artifactory.result == 'success' &&
913938
vars.DISABLE_REMOTE_TRIGGER != 'true'
@@ -973,7 +998,7 @@ jobs:
973998
# | ionos-dev | main | dev |
974999
# | ionos-stable | main | stable |
9751000
# | rc/* | main | rc |
976-
# | */dev/* | main | dev-<branch-pfx> |
1001+
# | */dev/* | main | dev-<branch-pfx> | (opt-in via ENABLE_REMOTE_TRIGGER_USER_DEV)
9771002
9781003
BUILD_TYPE="dev"
9791004

0 commit comments

Comments
 (0)