Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI workflow to check changes against the pull request base ref. #570

Merged
merged 1 commit into from
Dec 29, 2024
Merged
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
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
Loading