Skip to content

Instantly share code, notes, and snippets.

@altherlex
Last active June 19, 2020 07:35
Show Gist options
  • Save altherlex/15315bebfd9bc65ffb02fad8f899b6a6 to your computer and use it in GitHub Desktop.
Save altherlex/15315bebfd9bc65ffb02fad8f899b6a6 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# This script should be run via curl:
# sh -c "$(curl -fsSL https://gist.githubusercontent.com/altherlex/15315bebfd9bc65ffb02fad8f899b6a6/raw/azure-auto-changelog.sh)"
# or wget:
# sh -c "$(wget -qO- https://gist.githubusercontent.com/altherlex/15315bebfd9bc65ffb02fad8f899b6a6/raw/azure-auto-changelog.sh)"
export FILE_NAME=CHANGELOG-v.$RELEASE_VERSION.md
export TEMPLATE_URL=https://gist.githubusercontent.com/altherlex/5f20de7a31b08be82974f8e620310b74/raw/changelog-template.hbs
export AZURE_URL=https://dev.azure.com/GetSmartSolutions/The%20Product/_apis/git/pullrequests
export API_VERSION=5.1
export API_TARGETREFNAME=refs/heads/release/${RELEASE_VERSION}
export API_STATUS=completed
export API_TOP=10000
sudo /usr/local/bin/npm install -g git+https://github.com/altherlex/auto-changelog.git
sudo auto-changelog \
--commit-limit false \
--tag-pattern $RELEASE_VERSION.* \
--output ~/$FILE_NAME \
--azure-api "${AZURE_URL}?api-version=${API_VERSION}&searchCriteria.targetRefName=${API_TARGETREFNAME}&searchCriteria.status=${API_STATUS}&$top=${API_TOP}" \
--azure-user [email protected]:$PASSWORD \
--template $TEMPLATE_URL
cd ..
sudo git clone https://$USER:[email protected]/GetSmartSolutions/The%20Product/_git/The-Product.wiki
sudo mv ~/$FILE_NAME The-Product.wiki/Changlogs/.
cd The-Product.wiki
sudo git add . && sudo git commit -m 'add file '$FILE_NAME
sudo git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment