fix statement.txt json #16
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: Directory Change Workflow | |
on: | |
push: | |
branches: | |
- main # Replace with your desired branch | |
pull_request: | |
branches: | |
- main # Replace with your desired branch | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Get changed directories | |
id: changed-dirs | |
run: | | |
git fetch --prune | |
git diff --name-only $(git rev-parse origin/main)..$(git rev-parse HEAD) | cut -d'/' -f1 | sort -u > changed_dirs.txt | |
# - run: cat changed_files.txt | cut -d'/' -f1 | sort -u > changed_dirs.txt | |
- name: Run actions for changed directories | |
run: | | |
cat changed_dirs.txt | |
while IFS= read -r dir; do | |
echo "Processing $dir" | |
# Run your desired action logic for each directory here | |
done < changed_dirs.txt | |