Skip to content
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

Test changelog #377

Closed
11 changes: 7 additions & 4 deletions .github/scripts/release/create_changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ fi
GITHUB_URL=https://api.github.com/repos/$CODE_REPOSITORY
GITHUB_AUTH_HEADER="Authorization: Bearer $GITHUB_TOKEN"
CHANGELOG_FILE="CHANGELOG.md"

echo "$GITHUB_URL"
echo "$GITHUB_AUTH_HEADER"
echo "## What has changed" >> $CHANGELOG_FILE

git log "$LAST_RELEASE_TAG..$CURRENT_RELEASE_TAG" --pretty=tformat:"%h" --reverse | while read -r commit
git log "$LAST_RELEASE_TAG"..HEAD --pretty=tformat:"%h" --reverse | while read -r commit
do
COMMIT_AUTHOR=$(curl -H "$GITHUB_AUTH_HEADER" -sS "$GITHUB_URL"/commits/"$commit" | jq -r '.author.login')
git show -s "$commit" --format="* %s by @$COMMIT_AUTHOR" >> $CHANGELOG_FILE
if [ "${COMMIT_AUTHOR}" != "kyma-bot" ]; then
git show -s "${commit}" --format="* %s by @${COMMIT_AUTHOR}" >> ${CHANGELOG_FILE}
fi
done

{
Expand All @@ -33,5 +36,5 @@ done
echo "$DOCKER_IMAGE_URL"
} >> $CHANGELOG_FILE

echo $CHANGELOG_FILE
cat $CHANGELOG_FILE

Loading