Skip to content

Commit f5a0f6d

Browse files
committed
update .repo-metadata repo fields
1 parent 3e131c8 commit f5a0f6d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

monorepo-migration/migrate.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ check_command() {
2929
check_command git
3030
check_command python3
3131
check_command mvn
32+
check_command jq
3233

3334
# Configuration
3435
MONOREPO_URL="https://github.com/googleapis/google-cloud-java"
@@ -303,6 +304,19 @@ if [ -f "$COMMON_SH" ]; then
303304
git commit -n --no-gpg-sign -m "chore($SOURCE_REPO_NAME): add to excluded_modules in .kokoro/common.sh"
304305
COMMIT_COUNT=$((COMMIT_COUNT + 1))
305306
fi
307+
308+
# 6.8 Update .repo-metadata.json if it exists
309+
REPO_METADATA="$SOURCE_REPO_NAME/.repo-metadata.json"
310+
if [ -f "$REPO_METADATA" ]; then
311+
echo "Updating $REPO_METADATA..."
312+
# Update "repo" to googleapis/google-cloud-java and "repo_short" to google-cloud-java
313+
jq '.repo = "googleapis/google-cloud-java" | .repo_short = "google-cloud-java"' "$REPO_METADATA" > "${REPO_METADATA}.tmp" && mv "${REPO_METADATA}.tmp" "$REPO_METADATA"
314+
315+
echo "Committing $REPO_METADATA update..."
316+
git add "$REPO_METADATA"
317+
git commit -n --no-gpg-sign -m "chore($SOURCE_REPO_NAME): update .repo-metadata.json"
318+
COMMIT_COUNT=$((COMMIT_COUNT + 1))
319+
fi
306320
rm -f "$SOURCE_REPO_NAME/codecov.yaml"
307321
rm -f "$SOURCE_REPO_NAME/synth.metadata"
308322
rm -f "$SOURCE_REPO_NAME/license-checks.xml"

0 commit comments

Comments
 (0)