-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix-class1-urls.sh
More file actions
executable file
·22 lines (17 loc) · 784 Bytes
/
Copy pathfix-class1-urls.sh
File metadata and controls
executable file
·22 lines (17 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
WORKSPACE="/var$REPOS_DIR"
find "$WORKSPACE" -maxdepth 2 -name ".git" -type d | while read -r gitdir; do
repo_path=$(dirname "$gitdir")
repo_name=$(basename "$repo_path")
if [ "$repo_name" == "boj-server" ] || [ "$repo_name" == "scripts" ]; then
continue
fi
workflow="$repo_path/.github/workflows/boj-build.yml"
if [ -f "$workflow" ]; then
# Update the curl URL and the JSON payload to match the standard Class 1 'invoke' pattern
sed -i 's|/cartridges/ssg-mcp/build|/cartridges/ssg-mcp/invoke|g' "$workflow"
sed -i 's|"repo": "|"tool": "build", "args": "{\\"repo\\": \\"|g' "$workflow"
sed -i 's|"}"|\\"}"}|g' "$workflow"
echo "Fixed Class 1 URL for: $repo_name"
fi
done