From a375b01051a674e533ad57eaa941aeee335c9272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haris=20Osmanagi=C4=87?= Date: Thu, 9 Jan 2025 15:36:20 +0100 Subject: [PATCH] Keep project automation workflow only for Meroxa repositories (#68) --- setup.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/setup.sh b/setup.sh index 226b9dd..1b3c4d5 100755 --- a/setup.sh +++ b/setup.sh @@ -1,4 +1,24 @@ #!/bin/bash + +function cleanup_project_automation() { + # Get the remote URL and extract organization name + local REMOTE_URL=$(git config --get remote.origin.url) + local ORG_NAME=$(echo "$REMOTE_URL" | sed -E 's/.*[:/]([^/]*)\/.*/\1/') + + # Check if organization matches and delete file if it exists + if [[ "$ORG_NAME" =~ ^(conduitio|conduitio-labs|meroxa)$ ]]; then + local FILE_PATH=".github/workflows/project_automation.yaml" + if [ -f "$FILE_PATH" ]; then + rm "$FILE_PATH" + echo "Deleted $FILE_PATH" + else + echo "File $FILE_PATH not found" + fi + else + echo "Keeping the project automation workflow for $ORG_NAME" + fi +} + if [ $# -eq 0 ] then echo "Module name not provided." @@ -34,6 +54,8 @@ else sed -i "s~* @ConduitIO/conduit-core~ ~g" .github/CODEOWNERS fi +cleanup_project_automation + # Remove this script rm "$0" rm README.md