Is there a way to list only folders with changes
See original GitHub issueI’m working on a repo where this GitHub Action would be very useful. The folder structure is:
.
└── .github
└── workflows
└── deploy.yml
├── README.md
└── Services
├── serviceone
│ └── bunch_of_files
├── servicetwo
│ └── bunch_of_files
└── servicethree
└── bunch_of_files
The deploy.yml
file currently looks like
name: 'Deploy'
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check which services were modified
uses: dorny/paths-filter@v2
id: filter
with:
list-files: shell
filters: |
services:
- 'Services/**'
- name: Deploy changed services
if: ${{ steps.filter.outputs.services == 'true' }}
run: |
echo "All changes:"
for i in ${{ steps.filter.outputs.services_files }}; do echo $i | awk ; done
Instead of outputting the individual files changes in Services/**
is there a way to just output the folders containing changes such as
Services/serviceone
Services/servicethree
Thanks!
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:6
Top Results From Across the Web
git diff - only show which directories changed - Stack Overflow
yes, as I said, you get only directories with that command. The cut is doing that.
Read more >List Your Folder Structure in Windows - UW Finance
Open File Explorer in Windows. Navigate to the directory containing the folders you wish to appear in your list. Click in the address...
Read more >Linux / UNIX List Just Directories Or Directory Names - nixCraft
You can use combination of ls command, find command, and grep command to list directory names only. You can use the find command...
Read more >List of recently changed files for a directory and all ...
Try dir /a-d /o-d /tw /s (show files only, order by date descending, use last write time for sorting, recurse into subdirs). However...
Read more >Is there any way to list all folders ONLY in the level directly ...
Is there any way to list all folders ONLY in the... Learn more about path, files, directory, genpath, dotdot, dot, dot directory names....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
So my filters are just slightly different than the example. The key on the filter is a directory name and the value is the directory. After the matrix is setup I just set a default working-directory to the output from the matrix which is the key and therefore the directory I need to run from. Below is the example modified similiar to what I have.
So the two key points are key in the filter is the directory name and then the part:
This sets the working directory for the matrix jobs to src/{whatever the current matrix job is}
Does that make any sense? I could mock up a repo that shows the process if needed.
@ahrenstein @vincentgna
I ended up with this hacky solution:
It would be great to add an option that simulates it, something like
list-directories: shell
. I don’t mind adding a PR if it’s accepted by the owners.