Skip to content

Commit

Permalink
refactor: debugging the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ksachin7 committed Apr 1, 2024
1 parent 5053c95 commit 6f45478
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions .github/workflows/github.action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,26 +105,14 @@ jobs:
run: |
for dir in ui-fundamentals the-wild-oasis movies; do
cd $dir
# pwd
# Count the number of commits in the current branch
num_commits=$(git log --oneline | wc -l)
echo "Number of commits in $dir: $num_commits"
# Check if there are any commits in the current branch
if [[ $num_commits -eq 0 ]]; then
echo "No commits in $dir. Skipping deployment."
cd ..
continue
fi
# Check if there are commits in the branch
if git diff --name-only HEAD^..HEAD -- | grep -q .; then
if git diff --name-only HEAD^ HEAD -- $dir; then
echo "New files added/updated in $dir. Proceeding with deployment."
# Print all the files changed between the parent commit and the current commit
echo "Files changed:"
git diff --name-only HEAD^..HEAD
git diff --name-only HEAD^ HEAD -- $dir
npm install
npm run build
Expand Down

0 comments on commit 6f45478

Please sign in to comment.