Skip to content

Commit

Permalink
Keep project automation workflow only for Meroxa repositories (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
hariso authored Jan 9, 2025
1 parent cbe09e8 commit a375b01
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -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."
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a375b01

Please sign in to comment.