Skip to content

Commit

Permalink
feat: install pre-commit (#168)
Browse files Browse the repository at this point in the history
# Description

Adds a step to install pre-commit in the target repository.
  • Loading branch information
kayman-mk authored Jan 9, 2025
1 parent 9c4f7fd commit d60392f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 0 additions & 1 deletion .config/dictionaries/project.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ hlag
hmarr
ibiqlik
ludeeus
nullglob
ossrh
releaserc
rhysd
Expand Down
1 change: 1 addition & 0 deletions .config/dictionaries/workflow.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
codeowners
conventionalcommits
hapag
nullglob
10 changes: 10 additions & 0 deletions update_workflows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ repository_path=$(pwd)
branch_name="update-workflows-$(date +%s)"

function ensure_prerequisites_or_exit() {
if ! command -v pre-commit &> /dev/null; then
echo "pre-commit is not installed. https://github.com/pre-commit/pre-commit"
exit 1
fi

if ! command -v yq &> /dev/null; then
echo "yq is not installed. https://github.com/mikefarah/yq"
exit 1
Expand Down Expand Up @@ -217,6 +222,9 @@ fi
# setup the release workflow
if [ "$release_type" == "manual" ]; then
rm .github/workflows/default*release*_callable.yml

# fix the dictionary
sed -i '/conventionalcommits/d' .config/dictionaries/workflows.txt
fi

#
Expand Down Expand Up @@ -350,6 +358,8 @@ do
done
done

pre-commit install -c .config/.pre-commit-config.yaml

create_commit_and_pr .

rm -rf "$latest_template_path"

0 comments on commit d60392f

Please sign in to comment.