Files
cs249r_book/tools/scripts/check_workflow_changes.sh
Vijay Janapa Reddi 390d08d675 fix(ci): remove redundant docker pull in container job
Removes the explicit "Pull Linux Container" step from the containerized build workflow. This step was causing a "docker: command not found" error because it attempted to run `docker pull` from within the job container, which does not have the Docker client installed.

The `container:` directive in the job definition already handles pulling the required image, and it correctly utilizes the `actions/cache` step to accelerate the process. This change simplifies the workflow and resolves the execution error without impacting caching behavior.
2025-08-10 16:51:48 -04:00

28 lines
1001 B
Bash
Executable File

#!/bin/bash
# Allow bypassing the check with an environment variable
if [ "$ALLOW_WORKFLOW_CHANGES" = "true" ]; then
echo "✅ Bypassing workflow change check due to ALLOW_WORKFLOW_CHANGES flag"
exit 0
fi
# Check if any workflow files are being committed
if git diff --cached --name-only | grep -q "\.github/workflows/"; then
echo "⚠️ Workflow files detected in commit!"
echo "📋 This may cause issues with publish-live workflow."
echo "💡 Consider:"
echo " 1. Manual merge workflow changes first"
echo " 2. Then run publish-live for content only"
echo " 3. Or use a PAT with workflows:write permission"
echo ""
echo "🔍 Workflow files being committed:"
git diff --cached --name-only | grep "\.github/workflows/"
echo ""
read -p "Continue with commit? (y/N): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "❌ Commit cancelled"
exit 1
fi
echo "✅ Proceeding with workflow file changes"
fi