Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ability to output just folders containing changes #115

Open
Marcus-James-Adams opened this issue Nov 29, 2020 · 1 comment
Open

ability to output just folders containing changes #115

Marcus-James-Adams opened this issue Nov 29, 2020 · 1 comment

Comments

@Marcus-James-Adams
Copy link

Would it be possible to add an option where it could output a unique list of the folders that contain changed files rather than the files themselves?

We have a number of actions that need to run at the folder level rather than at the file.
currently, I strip off the filename to get the folder however that gives me duplicate folder names (where more than one file has changed within in it) causing my actions to run multiple times within the same folder skewing results.

@fabiano-amaral
Copy link

I had the same issue, i created a workaround with shell script to "solve"

job1:
    runs-on: ubuntu-latest
    steps:
     - id: file_changes
       uses: trilom/[email protected]

     - name: Get folders
       id: folders
       run: |
        content=$(jq ".[]" $HOME/files.json | sed 's/\/[^/]*$/\//' |  sed -e 's/^"//' -e 's/"$//' | grep '.*\/$' | uniq | jq -R -s -c 'split("\n")[:-1]')
        echo "::set-output name=folders::$content"
    outputs:
      folders: ${{ steps.folders.outputs.folders }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants