Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/status_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- uses: actions/setup-python@v4
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Get the commit message
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ exceeds a threshold.

## Usage
```yaml
- uses: ccdc-opensource/commit-hooks@v6
- uses: ccdc-opensource/commit-hooks@v7
with:
commitMessage: 'The commit message'
```
Expand All @@ -38,18 +38,18 @@ jobs:
Pull-request-files-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- uses: actions/setup-python@v4
- uses: actions/setup-python@v6
with:
python-version: "3.7"
python-version: "3.11"
- name: Get the commit message
run: |
echo "commit_message=$(git log --format=%B -n 1 ${{ github.event.after }})" >> $GITHUB_ENV
shell: bash
- uses: ccdc-opensource/commit-hooks@v6
- uses: ccdc-opensource/commit-hooks@v7
with:
commitMessage: ${{ env.commit_message }}
```
Expand Down
27 changes: 19 additions & 8 deletions main/commit-msg
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
#!/usr/bin/env bash
me=`basename "$0"`
me=$(basename "$0")

case "$OSTYPE" in
msys)
echo "Running ${me} in MinGW"
PYTHON_EXECUTABLE=python
;;
msys*|mingw*|cygwin*|win32*)
echo "Running ${me} on Windows"
if command -v python3 > /dev/null 2>&1; then
PYTHON_EXECUTABLE=(python3)
elif command -v python > /dev/null 2>&1; then
PYTHON_EXECUTABLE=(python)
else
echo "Error: Python not found or not runnable"
exit 1
fi
;;
Comment thread
mmaharjan-ccdc marked this conversation as resolved.
*)
echo "Running ${me} on linux / mac / unix"
if command -v python3 > /dev/null 2>&1; then
PYTHON_EXECUTABLE=python3
PYTHON_EXECUTABLE=(python3)
elif command -v python > /dev/null 2>&1; then
PYTHON_EXECUTABLE=(python)
else
PYTHON_EXECUTABLE=python
echo "Error: Python not found or not runnable"
exit 1
fi
;;
esac

${PYTHON_EXECUTABLE} "${BASH_SOURCE[0]%.*}.py" "$@"
"${PYTHON_EXECUTABLE[@]}" "${BASH_SOURCE[0]%.*}.py" "$@"
27 changes: 19 additions & 8 deletions main/pre-commit
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
#!/usr/bin/env bash
me=`basename "$0"`
me=$(basename "$0")

case "$OSTYPE" in
msys)
echo "Running ${me} in MinGW"
PYTHON_EXECUTABLE=python
;;
msys*|mingw*|cygwin*|win32*)
echo "Running ${me} on Windows"
if command -v python3 > /dev/null 2>&1; then
PYTHON_EXECUTABLE=(python3)
elif command -v python > /dev/null 2>&1; then
PYTHON_EXECUTABLE=(python)
else
echo "Error: Python not found or not runnable"
exit 1
fi
;;
Comment thread
mmaharjan-ccdc marked this conversation as resolved.
*)
echo "Running ${me} on linux / mac / unix"
if command -v python3 > /dev/null 2>&1; then
PYTHON_EXECUTABLE=python3
PYTHON_EXECUTABLE=(python3)
elif command -v python > /dev/null 2>&1; then
PYTHON_EXECUTABLE=(python)
else
PYTHON_EXECUTABLE=python
echo "Error: Python not found or not runnable"
exit 1
fi
;;
esac

${PYTHON_EXECUTABLE} "${BASH_SOURCE[0]%.*}.py" "$@"
"${PYTHON_EXECUTABLE[@]}" "${BASH_SOURCE[0]%.*}.py" "$@"
29 changes: 20 additions & 9 deletions main/pre-merge-commit
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
#!/usr/bin/env bash
me=`basename "$0"`
me=$(basename "$0")

case "$OSTYPE" in
msys)
echo "Running ${me} in MinGW"
PYTHON_EXECUTABLE=python
;;
msys*|mingw*|cygwin*|win32*)
echo "Running ${me} on Windows"
if command -v python3 > /dev/null 2>&1; then
PYTHON_EXECUTABLE=(python3)
elif command -v python > /dev/null 2>&1; then
PYTHON_EXECUTABLE=(python)
else
echo "Error: Python not found or not runnable"
exit 1
fi
;;
Comment thread
mmaharjan-ccdc marked this conversation as resolved.
*)
echo "Running ${me} linux / mac / unix"
echo "Running ${me} on linux / mac / unix"
if command -v python3 > /dev/null 2>&1; then
PYTHON_EXECUTABLE=python3
PYTHON_EXECUTABLE=(python3)
elif command -v python > /dev/null 2>&1; then
PYTHON_EXECUTABLE=(python)
else
PYTHON_EXECUTABLE=python
echo "Error: Python not found or not runnable"
exit 1
fi
;;
esac

${PYTHON_EXECUTABLE} "${BASH_SOURCE[0]%.*}.py" "$@"
"${PYTHON_EXECUTABLE[@]}" "${BASH_SOURCE[0]%.*}.py" "$@"