Skip to content

ops:triggering dev automation #8

ops:triggering dev automation

ops:triggering dev automation #8

Workflow file for this run

name: Detect Modified Folders
on:
push:
branches:
- fixes
path:
- apps/**
jobs:
detect-modified-folders:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: fixes
fetch-depth: 0
# - name: Set up Git
# run: git fetch --depth=2 origin +refs/heads/*:refs/remotes/origin/*
- name: Find modified folders
id: find_modified_folders
run: |
# Define the base directory
BASE_DIR="apps"
ROOT=$(pwd)
# Get the list of modified files in the specified directory
if [ "$(git rev-list --count HEAD)" -eq 1 ]; then
git ls-files $BASE_DIR | sed -E 's|/[^/]+$||' | sort -u
MODIFIED_FOLDERS=""
else
MODIFIED_FOLDERS=$(git diff --name-only HEAD^ HEAD -- $BASE_DIR \
| sed -E 's|/[^/]+$||' | sort -u)
fi
echo "Modified folders:"
echo "$MODIFIED_FOLDERS"
# Save the list to an output variable
echo "folders=$MODIFIED_FOLDERS" >> GITHUB_OUTPUT
- name: Debugging results
run: |
echo "The following folders have been modified: ${{ steps.find_modified_folders.outputs.folders }}"