-
Notifications
You must be signed in to change notification settings - Fork 11
feat: add make target to update enterprise repo org #201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,44 @@ | ||||||||||||
| #!/usr/bin/env bash | ||||||||||||
| # | ||||||||||||
| # Migrate all enterprise repo clones from openedx to edx github org. | ||||||||||||
| # | ||||||||||||
| # | ||||||||||||
| set -eu -o pipefail | ||||||||||||
|
|
||||||||||||
| REPOS=( | ||||||||||||
| enterprise-access | ||||||||||||
| enterprise-subsidy | ||||||||||||
| enterprise-catalog | ||||||||||||
| license-manager | ||||||||||||
|
|
||||||||||||
| # TODO frontend apps: | ||||||||||||
| # frontend-app-admin-portal | ||||||||||||
| # frontend-app-learner-portal-enterprise | ||||||||||||
| # frontend-app-enterprise-checkout | ||||||||||||
| # frontend-app-enterprise-public-catalog | ||||||||||||
|
|
||||||||||||
| # TODO libraries: | ||||||||||||
| # edx-enterprise | ||||||||||||
| # edx-enterprise-data | ||||||||||||
| # frontend-enterprise | ||||||||||||
| # enterprise-integrated-channels | ||||||||||||
| # edx-enterprise-subsidy-client | ||||||||||||
| ) | ||||||||||||
|
|
||||||||||||
| for repo in "${REPOS[@]}"; do | ||||||||||||
| echo "Updating $repo ..." | ||||||||||||
| if [ ! -d "$DEVSTACK_WORKSPACE/$repo" ]; then | ||||||||||||
|
||||||||||||
| echo "Skipping $repo (not found)" | ||||||||||||
| continue | ||||||||||||
| fi | ||||||||||||
| pushd "$DEVSTACK_WORKSPACE/$repo" >/dev/null | ||||||||||||
| OLD_ORIGIN=$(git remote get-url origin) | ||||||||||||
| git remote set-url origin $(git remote get-url origin | sed 's/openedx/edx/') | ||||||||||||
|
||||||||||||
| git remote set-url origin $(git remote get-url origin | sed 's/openedx/edx/') | |
| git remote set-url origin $(git remote get-url origin | sed 's|github.com/openedx/|github.com/edx/|') |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo-ing OLD_ORIGIN and NEW_ORIGIN directly can leak credentials if a Git remote URL embeds a username/password or PAT (e.g., https://user:token@github.com/org/repo.git), since these values will be printed to the terminal or any build logs capturing stdout. An attacker with access to terminal history or CI logs could recover these secrets. Avoid logging full remote URLs; instead, either omit them entirely or redact credentials (e.g., by stripping user:pass@ portions) before printing.
| echo "Old origin: ${OLD_ORIGIN}" | |
| echo "New origin: ${NEW_ORIGIN}" | |
| # Redact credentials from remote URLs before printing | |
| echo "Old origin: $(echo "${OLD_ORIGIN}" | sed -E 's#(https?://)[^/@]+@#\1#')" | |
| echo "New origin: $(echo "${NEW_ORIGIN}" | sed -E 's#(https?://)[^/@]+@#\1#')" |
Uh oh!
There was an error while loading. Please reload this page.