Skip to content

Commit

Permalink
Merge pull request #570 from catatsuy/feature-update-ci-workflow-gola…
Browse files Browse the repository at this point in the history
…ng-php-checks

Update CI workflow to check changes against the pull request base ref.
  • Loading branch information
catatsuy authored Dec 29, 2024
2 parents c40855d + 31f1762 commit 2dd9d8f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@ jobs:
id: check-changes
run: |
git fetch origin
if git diff --name-only origin/master...${{ github.sha }} | grep 'golang/'; then
CHANGED_FILES=$(git diff --name-only origin/${{ github.event.pull_request.base.ref }}...HEAD)
if echo "$CHANGED_FILES" | grep 'golang/'; then
echo "Changes detected in golang directory"
echo "go_changes_detected=true" >> $GITHUB_OUTPUT
exit 0
fi
if git diff --name-only origin/master...${{ github.sha }} | grep 'php/'; then
if echo "$CHANGED_FILES" | grep 'php/'; then
echo "Changes detected in php directory"
echo "php_changes_detected=true" >> $GITHUB_OUTPUT
exit 0
fi
- name: Download purl
Expand All @@ -56,7 +59,7 @@ jobs:
- name: Update compose.yml if changes are detected
if: steps.check-changes.outputs.php_changes_detected == 'true'
run: |
purl -fail -overwrite -replace '@context: (ruby|golang)/@context: php/@' ./webapp/docker-compose.yml
purl -fail -overwrite -replace '@context: ruby/@context: php/@' ./webapp/docker-compose.yml
mv webapp/etc/nginx/conf.d/default.conf webapp/etc/nginx/conf.d/default.conf.org
mv webapp/etc/nginx/conf.d/php.conf.org webapp/etc/nginx/conf.d/php.conf
Expand Down

0 comments on commit 2dd9d8f

Please sign in to comment.