feat: portal administration application #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check Changes in client/apps | |
on: | |
pull_request: | |
branches: | |
- "*" | |
push: | |
branches: | |
- "*" | |
jobs: | |
check-changes: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Fetch all commit history for proper comparison | |
- name: Fetch all branches | |
run: git fetch --all # Ensure all branches are fetched | |
- name: Check for changes in /client/apps | |
id: check_changes | |
run: | | |
# Check if we're in a pull request or push context | |
if [ "${{ github.event_name }}" == "pull_request" ]; then | |
# For pull requests, compare the base and head refs | |
git diff --name-only origin/${{ github.base_ref }}...${{ github.head_ref }} | grep -q "^client/apps/" | |
else | |
# For push events, compare with the previous commit | |
git diff --name-only HEAD^ HEAD | grep -q "^client/apps/" | |
fi | |
if [ $? -eq 0 ]; then | |
echo "Changes detected in client/apps/" | |
echo "::set-output name=changes_detected::true" | |
else | |
echo "No changes detected in client/apps/" | |
echo "::set-output name=changes_detected::false" | |
fi | |
- name: Output result | |
run: | | |
echo "Changes in client/apps: ${{ steps.check_changes.outputs.changes_detected }}" |