feat: portal administration application #14
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 accurate comparison | |
- name: Fetch base and head branches | |
run: | | |
# Fetch the base branch explicitly (e.g., 'main') | |
git fetch origin ${{ github.base_ref }} | |
# Fetch the head branch (current branch in the workflow context) | |
git fetch origin ${{ github.head_ref }} | |
- name: Check for changes in /client/apps | |
id: check_changes | |
run: | | |
# Compare base and head refs for pull requests | |
if [ "${{ github.event_name }}" == "pull_request" ]; then | |
# Use the fetched branches for comparison | |
git diff --name-only origin/${{ github.base_ref }}...origin/${{ github.head_ref }} | grep -q "^client/apps/" | |
else | |
# For push events, compare the last commit with the previous commit | |
git diff --name-only HEAD^ HEAD | grep -q "^client/apps/" | |
fi | |
# Check the result of the previous command | |
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 }}" |