From 59abef54c1d8d95cdf787516425503276c81cea1 Mon Sep 17 00:00:00 2001 From: catatsuy Date: Sun, 29 Dec 2024 17:47:21 +0900 Subject: [PATCH] Update CI workflow to check for changes in 'ruby/' directory --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8fbce90b..a8efed09 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,9 +35,11 @@ jobs: id: check-changes run: | git fetch origin - if git diff --name-only origin/master...${{ github.sha }} | grep 'ruby/'; then + CHANGED_FILES=$(git diff --name-only origin/${{ github.event.pull_request.base.ref }}...HEAD) + if echo "$CHANGED_FILES" | grep 'ruby/'; then echo "Changes detected in ruby directory" echo "ruby_changes_detected=true" >> $GITHUB_OUTPUT + exit 0 fi - name: Download purl @@ -51,7 +53,7 @@ jobs: - name: Update compose.yml if changes are detected if: steps.check-changes.outputs.ruby_changes_detected == 'true' run: | - purl -overwrite -replace '@dockerfile: go/@dockerfile: ruby/@' ./webapp/compose.yml + purl -fail -overwrite -replace '@dockerfile: go/@dockerfile: ruby/@' ./webapp/compose.yml - name: Start the server run: |