Skip to content

Commit

Permalink
feat: generate changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
StephaneBour committed Apr 15, 2020
1 parent d1de3a2 commit cac3e5a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Run
FROM alpine:3.10
FROM node:alpine3.10 as run

RUN apk add --no-cache curl git

RUN npm install -g conventional-changelog-cli

COPY entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The title of the release. Default `release: version ${NEXT_RELEASE}`.

### `message`

The message of the release. Default `${NEXT_RELEASE}`.
The message of the release. Default generate conventional changelog.

### `draft`

Expand Down
5 changes: 3 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ if [ "${NAME}" = "0" ]; then
fi

if [ "${MESSAGE}" = "0" ]; then
MESSAGE="${NEXT_RELEASE}"
MESSAGE=$(conventional-changelog)
fi


echo "Next release : ${NEXT_RELEASE}"

echo "${MESSAGE}"

if [ "${CREATE_RELEASE}" = "true" ]; then
API_JSON=$(printf '{"tag_name": "%s","target_commitish": "%s","name": "%s","body": "%s","draft": %s,"prerelease": %s}' "$NEXT_RELEASE" "$BRANCH" "$NEXT_RELEASE" "$MESSAGE" "$DRAFT" "$PRE" )
curl --fail --data "${API_JSON}" -s -i "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases?access_token=${GITHUB_TOKEN}"
Expand Down

0 comments on commit cac3e5a

Please sign in to comment.