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
3 changes: 3 additions & 0 deletions .actrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Act configuration file
# Use smaller runners for faster testing
-P ubuntu-latest=catthehacker/ubuntu:act-latest
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM babashka/babashka:1.3.191-alpine

# Install git (needed for git log command in entrypoint)
RUN apk add --no-cache git
# Install git, bash, and openjdk (needed for babashka dependencies)
RUN apk add --no-cache git bash openjdk21-jre

# Set working directory
WORKDIR /action
Expand Down
35 changes: 31 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,36 @@ if [ -n "$COMMIT_MESSAGE" ]; then
echo "Checking provided commit message: $COMMIT_MESSAGE"
else
# Get the last commit message if none provided
git log -1 --pretty=%B > "$COMMIT_FILE"
COMMIT_MESSAGE=$(cat "$COMMIT_FILE")
echo "Checking last commit message: $COMMIT_MESSAGE"
# Try different possible workspace locations for GitHub Actions
WORKSPACE_DIRS=(
"/github/workspace"
"$GITHUB_WORKSPACE"
"$(pwd)"
)

GIT_DIR_FOUND=false
for workspace_dir in "${WORKSPACE_DIRS[@]}"; do
if [ -n "$workspace_dir" ] && [ -d "$workspace_dir" ]; then
echo "Checking for git repository in: $workspace_dir"
cd "$workspace_dir"
if git rev-parse --git-dir > /dev/null 2>&1; then
git log -1 --pretty=%B > "$COMMIT_FILE"
COMMIT_MESSAGE=$(cat "$COMMIT_FILE")
echo "Checking last commit message: $COMMIT_MESSAGE"
GIT_DIR_FOUND=true
break
fi
fi
done

if [ "$GIT_DIR_FOUND" = false ]; then
echo "Error: No git repository found and no commit message provided"
echo "Tried directories: ${WORKSPACE_DIRS[*]}"
echo "Current working directory: $(pwd)"
echo "Directory listing:"
ls -la
exit 1
fi
fi

# Prepare arguments
Expand Down Expand Up @@ -129,4 +156,4 @@ if [ "$FAIL_ON_ERROR" = "false" ]; then
exit 0
else
exit $EXIT_CODE
fi
fi