diff --git a/.all-contributorsrc b/.all-contributorsrc index a8a750ec..c0e6d22c 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -204,7 +204,8 @@ "avatar_url": "https://avatars.githubusercontent.com/u/7644094?v=4", "profile": "https://blog.airey.be", "contributions": [ - "bug" + "bug", + "review" ] }, { @@ -226,6 +227,25 @@ "question", "doc" ] + }, + { + "login": "xontab", + "name": "Shaun Tabone", + "avatar_url": "https://avatars.githubusercontent.com/u/4987684?v=4", + "profile": "http://www.xontab.com", + "contributions": [ + "code" + ] + }, + { + "login": "kevin-aude", + "name": "Kevin AUDE", + "avatar_url": "https://avatars.githubusercontent.com/u/98819045?v=4", + "profile": "https://github.com/kevin-aude", + "contributions": [ + "ideas", + "code" + ] } ], "contributorsPerLine": 7, diff --git a/CHANGELOG.md b/CHANGELOG.md index 02dc7bf5..ea215907 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.3.0](https://github.com/AndreasAugustin/actions-template-sync/compare/v1.2.0...v1.3.0) (2024-01-18) + + +### Features + +* **hooks:** added precommit hook ([#439](https://github.com/AndreasAugustin/actions-template-sync/issues/439)) ([4a42410](https://github.com/AndreasAugustin/actions-template-sync/commit/4a42410a3c63b359844b20860359bc2f8ab4e6fa)) + ## [1.2.0](https://github.com/AndreasAugustin/actions-template-sync/compare/v1.1.9...v1.2.0) (2024-01-06) diff --git a/README.md b/README.md index b2d5282a..d14d82aa 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # actions-template-sync -[![All Contributors](https://img.shields.io/badge/all_contributors-22-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-24-orange.svg?style=flat-square)](#contributors-) [![actions-template-sync](https://github.com/AndreasAugustin/actions-template-sync/actions/workflows/actions_template_sync.yml/badge.svg)](https://github.com/AndreasAugustin/actions-template-sync/actions/workflows/actions_template_sync.yml) @@ -362,6 +362,7 @@ The following hooks are supported (please check [docs/ARCHITECTURE.md](docs/ARCH * `install` is executed after the container has started and after reading and setting up the environment. * `prepull` is executed before the code is pulled from the source repository +* `precommit` is executed before the code is commited * `prepush` is executed before the push is executed, right after the commit * `prepr` is executed before the PR is done @@ -380,6 +381,10 @@ hooks: commands: - echo 'hi, we are within the prepull phase' - echo 'maybe you want to do adjustments on the local code' + precommit: + commands: + - echo 'hi, we are within the precommit phase' + - echo 'maybe you want to add further changes before the code is committed' prepush: commands: - echo 'hi, we are within the prepush phase' @@ -517,11 +522,13 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Eleanor Bronson
Eleanor Bronson

🤔 Marvin Osswald
Marvin Osswald

📖 David Calvert
David Calvert

📖 🐛 💻 🚧 📝 - Andy Airey
Andy Airey

🐛 + Andy Airey
Andy Airey

🐛 👀 Surya Asriadie
Surya Asriadie

🐛 jellllly420
jellllly420

🤔 💬 📖 + Shaun Tabone
Shaun Tabone

💻 + Kevin AUDE
Kevin AUDE

🤔 💻 diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 73375c6e..843f0ddc 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -35,7 +35,7 @@ GitCommitSync["fa:fa-code-commit Commit the changes"] CheckIsDryRun{"Check if is_dry_run is set to true"} GitPushSync["Push the changes to GitHub"] GitPullRequestSync["fa:fa-code-pull-request Create a pull request on GitHub"] -Hook{{"hooks, prepush | prepush | prepr"}} +Hook{{"hooks, prepull | precommit | prepush | prepr"}} subgraph githubactions["fa:fa-github GitHubActions"] diff --git a/src/sync_template.sh b/src/sync_template.sh index c4855b83..2a07ff93 100644 --- a/src/sync_template.sh +++ b/src/sync_template.sh @@ -94,6 +94,8 @@ if [ -s "${TEMPLATE_SYNC_IGNORE_FILE_PATH}" ]; then echo "::endgroup::" fi +cmd_from_yml_file "precommit" + echo "::group::commit changes" git add .