Skip to content

Conversation

diogokiss
Copy link

@diogokiss diogokiss commented Aug 27, 2025

This commit introduces a new input named 'write-to-files'. It enables writing
the lists of matching files to a corresponding file in addition to the output
'_files'. If set, the action will create the specified file with
the list of matching files. The file will be written in the format specified by
the list-files option and named after the filter. The path to the file will be
output as a variable named <filter-name>_files_path.

Example of the issue

    - name: List changed files
      uses: dorny/paths-filter@v3
      id: changed
      with:
        filters: .github/path_filters.yaml
        list-files: escape
        write-to-files: true
        token: '' # Forces the use of the git binary (necessary for 3000+ files change sets)


    - name: Update the changed content files in the destination with the Pull Request changes
      shell: bash
      env:
        SOURCE: ${{ inputs.source }}
        DESTINATION_PATH: ${{ inputs.mountpoint }}/${{ inputs.destination }}
        CHANGED_CONTENT_FILES: ${{ steps.changed.outputs.content_files }}
      run: |
        RELATIVE_PATHS_LIST=$(printf '%s\n' ${{ steps.changed.outputs.content_files }} | xargs realpath -m --relative-to="${SOURCE}")
        cd "${SOURCE}"
        while read -r BATCH
         do
          cp --parents ${BATCH} ${DESTINATION_PATH}
        done <<< $(printf '%s\n' "${RELATIVE_PATHS_LIST}" | xargs)

GitHub Actions message

Note

The change set tested has more than 2600 files. I wasn't even able to paste it here as a comment.

Error: An error occurred trying to start process '/usr/bin/docker' with working directory '/home/runner/_work'.
Argument list too long

@diogokiss diogokiss marked this pull request as ready for review August 27, 2025 14:14
@diogokiss diogokiss force-pushed the write-to-files-option branch 3 times, most recently from b6ca33e to 205faac Compare August 27, 2025 14:51
This commit introduces a new input named 'write-to-files'. It enables writing
the lists of matching files to a corresponding file in addition to the output
'<filter-name>_files'. If set, the action will create the specified file with
the list of matching files. The file will be written in the format specified by
the `list-files` option and named after the filter. The path to the file will be
output as a variable named `<filter-name>_files_path`.
@diogokiss diogokiss force-pushed the write-to-files-option branch from 205faac to 8ec3b44 Compare August 27, 2025 14:52
@diogokiss
Copy link
Author

Hi, @dorny ! 🙋🏻

Do you think you'd be able to review this Pull Request?

I noticed that the last Pull Request taken in this repository was around 1 year ago.
If you're not maintaining this repository anymore it would be a pity, but totally understandable. ✌🏻

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

Successfully merging this pull request may close these issues.

1 participant