Skip to content

Commit

Permalink
Fix invalid changelogs / update changelog workflows (#1002)
Browse files Browse the repository at this point in the history
* 📝 Fix invalid changelogs

Signed-off-by: Rintaro Okamura <[email protected]>

* 🐛 Fix a bug in Makefile that introduced at v1 release

Signed-off-by: Rintaro Okamura <[email protected]>

* 📝 update changelog template

Signed-off-by: Rintaro Okamura <[email protected]>

* 🔧 Revise changelog workflow

Signed-off-by: Rintaro Okamura <[email protected]>

* 📝 update chatops commands.md

Signed-off-by: Rintaro Okamura <[email protected]>

* 📝 update table

Signed-off-by: Rintaro Okamura <[email protected]>
  • Loading branch information
rinx authored Feb 18, 2021
1 parent 9394142 commit 0218497
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 135 deletions.
2 changes: 1 addition & 1 deletion .github/chatops_commands.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- :ok_woman: `/approve` - approve
- :love_letter: `/changelog` - add changelog comment
- :love_letter: `/changelog` - replace the PR body by changelog details
- :bento: `/format` - format codes and add licenses
- :white_check_mark: `/gen-test` - generate test codes
- :label: `/label` - add labels
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/chatops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,21 @@ jobs:
PREVIOUS_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))
BODY=`git log --pretty=format:'- %s' ${PREVIOUS_VERSION}..master | grep "#[[:digit:]]\+" | sed -e "s/\[\(patch\|minor\|major\)\] *//g" | sed -e "s%#\([[:digit:]]\+\)%[&](https://github.com/vdaas/vald/pull/\1)%g" | sed ':a;N;$!ba;s/\n/\\\\n/g'`
CURRENT="- ${PR_TITLE} ([#${PR_NUM}](https://github.com/vdaas/vald/pull/${PR_NUM}))"
curl --include --verbose --fail \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-H "Authorization: token ${GITHUB_TOKEN}" \
--request PATCH \
--data "{\"body\": \"${CURRENT}\\n${BODY}\"}" \
https://api.github.com/repos/vdaas/vald/pulls/${PR_NUM}
curl --include --verbose --fail \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-H "Authorization: token ${GITHUB_TOKEN}" \
--request POST \
--data "{\"body\": \"**[CHANGELOG]** Please edit the following lines.\\n${CURRENT}\\n${BODY}\"}" \
--data "{\"body\": \"**[CHANGELOG]** The description of this PR is updated. Please edit it.\"}" \
$API_URL
env:
GITHUB_TOKEN: ${{ secrets.DISPATCH_TOKEN }}
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/semver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ jobs:
BODY=""
if [ ! -z "${PR_NUM}" ]; then
PR_COMMENTS=`curl https://api.github.com/repos/${GITHUB_REPOSITORY}/issues/${PR_NUM}/comments?per_page=10000`
BODY=`echo -E $PR_COMMENTS | jq 'last(.[] | select(.user.login == "vdaas-ci") | select(.body | test("^\\\\*\\\\*\\\\[CHANGELOG")))' -r | jq '.body'`
BODY=`echo -e $BODY | tail -n +2`
BODY=`curl -s "https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/${PR_NUM}" | jq -r '.body'`
fi
if [ -z "$BODY" ]; then
Expand Down
Loading

0 comments on commit 0218497

Please sign in to comment.