Skip to content

Commit b3474bf

Browse files
IONOS(ci): trigger remote workflow for rc/* and */dev/* branches
Extends three things to handle the newly-buildable rc/* and */dev/* branches: 1. trigger-remote-dev-workflow's gating condition now accepts rc/* and */dev/* refs in addition to ionos-dev/ionos-stable. 2. BUILD_TYPE mapping in the GitLab webhook payload: - rc/* → 'rc' - */dev/* → 'dev-<owner-slug>' (matches the Artifactory stage prefix introduced in the companion 'route rc/*…' commit so the GitLab side can reason about artifact location consistently). 3. The prepare-matrix preflight-summary branch-validity regex now matches the same four patterns, so the predicted go/no-go in the step summary stays accurate. GitLab pipeline coordination: the new BUILD_TYPE values land in the trigger payload's `variables[BUILD_TYPE]`. Coordinate with the GitLab maintainer to confirm the downstream pipeline handles 'rc' and 'dev-*' explicitly (or accepts them as fallthrough to 'dev'-like behavior).
1 parent 8653453 commit b3474bf

1 file changed

Lines changed: 18 additions & 11 deletions

File tree

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

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ jobs:
156156
echo " ✅ Event type is 'push'"
157157
fi
158158
159-
VALID_BRANCH_PATTERN='^(ionos-dev|ionos-stable)$'
159+
VALID_BRANCH_PATTERN='^(ionos-dev|ionos-stable)$|^rc/.*$|^[^/]+/dev/.*$'
160160
if [[ ! "${{ github.ref_name }}" =~ $VALID_BRANCH_PATTERN ]]; then
161-
echo "- ❌ Branch must be 'ionos-dev' or 'ionos-stable' (current: \`${{ github.ref_name }}\`)" >> $GITHUB_STEP_SUMMARY
162-
echo " ❌ Branch is '${{ github.ref_name }}' (must be 'ionos-dev' or 'ionos-stable')"
161+
echo "- ❌ Branch must be 'ionos-dev', 'ionos-stable', 'rc/*' or '*/dev/*' (current: \`${{ github.ref_name }}\`)" >> $GITHUB_STEP_SUMMARY
162+
echo " ❌ Branch is '${{ github.ref_name }}' (must be 'ionos-dev', 'ionos-stable', 'rc/*' or '*/dev/*')"
163163
WILL_TRIGGER=false
164164
else
165165
echo "- ✅ Branch is '\`${{ github.ref_name }}\`'" >> $GITHUB_STEP_SUMMARY
@@ -883,13 +883,14 @@ jobs:
883883

884884
name: Trigger remote workflow
885885
needs: [ hidrive-next-build, upload-to-artifactory ]
886-
# Trigger remote build on "ionos-dev|ionos-stable" branch *push* defined in the on:push:branches
886+
# Trigger remote build on "ionos-dev|ionos-stable|rc/*|*/dev/*" branch *push* defined in on:push:branches
887887
# Can be disabled via repository variable 'DISABLE_REMOTE_TRIGGER' (set to 'true' to disable)
888888
# Configure at: https://github.com/IONOS-Productivity/nc-server/settings/variables/actions
889889
if: |
890890
always() &&
891891
github.event_name == 'push' &&
892-
(github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable') &&
892+
(github.ref_name == 'ionos-dev' || github.ref_name == 'ionos-stable' ||
893+
startsWith(github.ref_name, 'rc/') || contains(github.ref_name, '/dev/')) &&
893894
needs.hidrive-next-build.result == 'success' &&
894895
needs.upload-to-artifactory.result == 'success' &&
895896
vars.DISABLE_REMOTE_TRIGGER != 'true'
@@ -950,16 +951,22 @@ jobs:
950951
set -x
951952
952953
# Branch to GitLab Trigger Mapping (see HDNEXT-1373):
953-
# | ref_name | GITLAB_REF | BUILD_TYPE |
954-
# |--------------|------------|------------|
955-
# | ionos-dev | main | dev |
956-
# | ionos-stable | main | stable |
954+
# | ref_name | GITLAB_REF | BUILD_TYPE |
955+
# |--------------|------------|-------------------|
956+
# | ionos-dev | main | dev |
957+
# | ionos-stable | main | stable |
958+
# | rc/* | main | rc |
959+
# | */dev/* | main | dev-<branch-pfx> |
957960
958961
BUILD_TYPE="dev"
959962
960-
# Override build type for stable branch
961-
if [ ${{ github.ref_name }} == "ionos-stable" ]; then
963+
if [ "${{ github.ref_name }}" == "ionos-stable" ]; then
962964
BUILD_TYPE="stable"
965+
elif [[ "${{ github.ref_name }}" =~ ^rc/ ]]; then
966+
BUILD_TYPE="rc"
967+
elif [[ "${{ github.ref_name }}" =~ ^.*/dev/.*$ ]]; then
968+
BRANCH_PREFIX=$(echo "${{ github.ref_name }}" | sed 's|/.*||' | sed 's/[^A-Za-z0-9._-]/-/g')
969+
BUILD_TYPE="dev-${BRANCH_PREFIX}"
963970
fi
964971
965972
# Construct source build URL for traceability

0 commit comments

Comments
 (0)