diff --git a/bin/bump-version b/bin/bump-version new file mode 100755 index 00000000..e1521fee --- /dev/null +++ b/bin/bump-version @@ -0,0 +1,28 @@ +#!/bin/bash + +usage() { echo "Usage: $0 -p [major | minor | patch]" 1>&2; exit 1; } + +while getopts "p:" o; do + case "${o}" in + p) + patch_level=${OPTARG} + (( patch_level == 'major' || patch_level == 'minor' || patch_level == 'patch')) + ;; + *) + usage + ;; + esac +done + +echo "$patch_level" + +if [[ -z "${patch_level}" ]]; then + usage +fi + +new_version=$(npm version "${patch_level}" --no-git-tag-version) +git checkout -b "${new_version}"-release-notes +git add package.json package-lock.json +git commit -m "${new_version}" + +echo "Branch prepared for ${new_version}" diff --git a/package-lock.json b/package-lock.json index 8ed9d9ee..25e75ae9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dependabot-pull-request-action", - "version": "1.1.1", + "version": "1.2.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "dependabot-pull-request-action", - "version": "1.1.1", + "version": "1.2.1", "license": "MIT", "dependencies": { "@actions/core": "^1.6.0", diff --git a/package.json b/package.json index a9b3b93f..64f880a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dependabot-pull-request-action", - "version": "1.1.1", + "version": "1.2.1", "description": "Parse Dependabot commit metadata to automate PR handling", "main": "dist/index.js", "scripts": {