Skip to content

Instantly share code, notes, and snippets.

@KyMidd

KyMidd/asdf.sh Secret

Created February 19, 2023 17:50
Show Gist options
  • Select an option

  • Save KyMidd/4680f3358d962c641afc35d8cb64d8e7 to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/4680f3358d962c641afc35d8cb64d8e7 to your computer and use it in GitHub Desktop.
# Fetch stash repo correct spelling, if different from github name, correct name on github
# Fetch correct capitalization of name from stash
REPO_CORRECT_CAPS=$(curl -s --user $STASH_USER:$STASH_PASS https://$STASH_URL/rest/api/1.0/projects/$STASH_PROJECT_KEY/repos/$GH_REPO | jq -r .name)
echo "Correcting casing of repo names to match stash"
CORRECT_REPO_CASING=$(curl -s \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$GH_ORG/$GH_REPO \
-d "{\"name\":\"$REPO_CORRECT_CAPS\"}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment