Skip to content

Commit

Permalink
feat: adding ability to run pre-commit script. (#9)
Browse files Browse the repository at this point in the history
* feat: adding ability to run pre-commit script.

* fix: removing bad double quotes.
  • Loading branch information
neverendingqs authored Aug 24, 2020
1 parent 6b28c07 commit f8da6e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ inputs:
git-user-name:
description: Git user.name to use for the commit.
default: github-actions[bot]
pre-commit-script:
description: A command to run before committing the dependency changes (e.g. npm run build)
package-manager:
description: Set to 'yarn' to use yarn. Defaults to npm.
default: npm
Expand All @@ -24,3 +26,4 @@ runs:
- ${{ inputs.git-user-email }}
- ${{ inputs.package-manager }}
- ${{ inputs.bump-version }}
- ${{ inputs.pre-commit-script }}
6 changes: 6 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ GIT_USER_NAME=${1}
GIT_USER_EMAIL=${2}
PACKAGE_MANAGER=${3}
BUMP_VERSION=${4}
PRE_COMMIT_SCRIPT=${5}

npx npm-check-updates -u

Expand Down Expand Up @@ -37,6 +38,11 @@ PR_BRANCH=chore/deps-$(date +%s)
git config user.name ${GIT_USER_NAME}
git config user.email ${GIT_USER_EMAIL}
git checkout -b ${PR_BRANCH}

if [ -n "${PRE_COMMIT_SCRIPT}" ]; then
${PRE_COMMIT_SCRIPT}
fi

git commit -am "${DESCRIPTION}"
git push origin ${PR_BRANCH}

Expand Down

0 comments on commit f8da6e1

Please sign in to comment.