├── .gitignore ├── Brewfile ├── .dockerignore ├── README.md ├── entrypoint.sh ├── script └── bootstrap ├── LICENSE.txt ├── .github └── main.workflow └── Dockerfile /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /Brewfile: -------------------------------------------------------------------------------- 1 | brew "shellcheck" 2 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | # ignore all files by default 2 | * 3 | # include required files with an exception 4 | !entrypoint.sh 5 | !LICENSE.txt 6 | !README.md 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Conventional Commits Action 2 | 3 | Automatically tag releases and generate a CHANGELOG, based on the 4 | [Conventional Commits Spec](https://www.conventionalcommits.org/en/v1.0.0-beta.2/). 5 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | npm i standard-version@next -g 6 | git config --global user.email "${GITHUB_EMAIL}" 7 | git config --global user.name "${GITHUB_ACTOR}" 8 | sh -c "alias git=hub" 9 | sh -c "git pull --tags" 10 | sh -c "standard-version" 11 | git push origin master 12 | git push --tags 13 | -------------------------------------------------------------------------------- /script/bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # script/bootstrap: Resolve dependencies that the application requires to run. 3 | 4 | # Exit if any subcommand fails 5 | set -e 6 | 7 | # Ensure we're always running from the project root 8 | cd "$(dirname "$0")/.." 9 | 10 | if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then 11 | brew bundle check >/dev/null 2>&1 || { 12 | echo "==> Installing Homebrew dependencies…" 13 | brew bundle 14 | } 15 | fi 16 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018, Contributors 2 | 3 | Permission to use, copy, modify, and/or distribute this software 4 | for any purpose with or without fee is hereby granted, provided 5 | that the above copyright notice and this permission notice 6 | appear in all copies. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES 10 | OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE 11 | LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES 12 | OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 13 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 14 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | -------------------------------------------------------------------------------- /.github/main.workflow: -------------------------------------------------------------------------------- 1 | workflow "Build and Publish" { 2 | on = "push" 3 | resolves = "Docker Publish" 4 | } 5 | 6 | action "Shell Lint" { 7 | uses = "actions/bin/shellcheck@master" 8 | args = "entrypoint.sh" 9 | } 10 | 11 | action "Docker Lint" { 12 | uses = "docker://replicated/dockerfilelint" 13 | args = ["Dockerfile"] 14 | } 15 | 16 | action "Build" { 17 | needs = ["Shell Lint", "Docker Lint"] 18 | uses = "actions/docker/cli@master" 19 | args = "build -t conventional-commits ." 20 | } 21 | 22 | action "Docker Tag" { 23 | needs = ["Build"] 24 | uses = "actions/docker/tag@master" 25 | args = "conventional-commits bcoe/conventional-commits --no-latest" 26 | } 27 | 28 | action "Publish Filter" { 29 | needs = ["Build"] 30 | uses = "actions/bin/filter@master" 31 | args = "branch master" 32 | } 33 | 34 | action "Docker Login" { 35 | needs = ["Publish Filter"] 36 | uses = "actions/docker/login@master" 37 | secrets = ["DOCKER_USERNAME", "DOCKER_PASSWORD"] 38 | } 39 | 40 | action "Docker Publish" { 41 | needs = ["Docker Tag", "Docker Login"] 42 | uses = "actions/docker/cli@master" 43 | args = "push bcoe/conventional-commits" 44 | } 45 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:8-alpine 2 | 3 | LABEL version="0.0.1" 4 | LABEL repository="http://github.com/bcoe/conventional-commits-action" 5 | LABEL homepage="http://github.com/bcoe/conventional-commits-action" 6 | LABEL maintainer="Ben Coe " 7 | 8 | LABEL com.github.actions.name="GitHub Action for Conventional Commits" 9 | LABEL com.github.actions.description="Automatically tag releases and generate a CHANGELOG, based on the Conventional Commits spec." 10 | LABEL com.github.actions.icon="checklist" 11 | LABEL com.github.actions.color="yellow" 12 | 13 | RUN apk update && \ 14 | apk upgrade && \ 15 | apk add --no-cache \ 16 | git \ 17 | bash \ 18 | go \ 19 | libc-dev 20 | 21 | RUN mkdir /tmp/hub 22 | RUN ["/bin/bash", "-c", "set -o pipefail \ 23 | && git clone https://github.com/github/hub.git /tmp/hub \ 24 | && cd /tmp/hub \ 25 | && git fetch --tags \ 26 | && git checkout v2.2.9 \ 27 | && ./script/build" ] 28 | 29 | RUN mv /tmp/hub/bin/hub /usr/bin/hub 30 | COPY LICENSE.txt /LICENSE.txt 31 | COPY README.md /README.md 32 | COPY "entrypoint.sh" "/entrypoint.sh" 33 | ENTRYPOINT ["/entrypoint.sh"] 34 | CMD ["help"] 35 | --------------------------------------------------------------------------------