Skip to content

Commit f8da6e1

Browse files
feat: adding ability to run pre-commit script. (#9)
* feat: adding ability to run pre-commit script. * fix: removing bad double quotes.
1 parent 6b28c07 commit f8da6e1

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

action.yml

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ inputs:
1313
git-user-name:
1414
description: Git user.name to use for the commit.
1515
default: github-actions[bot]
16+
pre-commit-script:
17+
description: A command to run before committing the dependency changes (e.g. npm run build)
1618
package-manager:
1719
description: Set to 'yarn' to use yarn. Defaults to npm.
1820
default: npm
@@ -24,3 +26,4 @@ runs:
2426
- ${{ inputs.git-user-email }}
2527
- ${{ inputs.package-manager }}
2628
- ${{ inputs.bump-version }}
29+
- ${{ inputs.pre-commit-script }}

entrypoint.sh

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ GIT_USER_NAME=${1}
55
GIT_USER_EMAIL=${2}
66
PACKAGE_MANAGER=${3}
77
BUMP_VERSION=${4}
8+
PRE_COMMIT_SCRIPT=${5}
89

910
npx npm-check-updates -u
1011

@@ -37,6 +38,11 @@ PR_BRANCH=chore/deps-$(date +%s)
3738
git config user.name ${GIT_USER_NAME}
3839
git config user.email ${GIT_USER_EMAIL}
3940
git checkout -b ${PR_BRANCH}
41+
42+
if [ -n "${PRE_COMMIT_SCRIPT}" ]; then
43+
${PRE_COMMIT_SCRIPT}
44+
fi
45+
4046
git commit -am "${DESCRIPTION}"
4147
git push origin ${PR_BRANCH}
4248

0 commit comments

Comments
 (0)