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

[Feature] Output which file changed from files input #895

Closed
2 tasks done
kemalgoklen opened this issue Dec 22, 2022 · 4 comments
Closed
2 tasks done

[Feature] Output which file changed from files input #895

kemalgoklen opened this issue Dec 22, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@kemalgoklen
Copy link

Is this feature missing in the latest version?

  • I'm using the latest release

Is your feature request related to a problem? Please describe.

Hello,
Since the action has yet to have such a feature, the overall workflow file is getting complex. Since I can only get a boolean from the output of files input, it does not bring any filtration over my files(it does, but I need to check the file contents as well and run more than one matrix based on file content and if it's changed or not). Along with getting any_changed = 'true | false', I'd love to have an exact filename like the all_changed_files output

Describe the solution you'd like?

Along with getting any_changed = 'true | false', I'd love to have an exact filename like the all_changed_files output files_input_changed = 'filename'

Describe alternatives you've considered?

No response

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@kemalgoklen kemalgoklen added the enhancement New feature or request label Dec 22, 2022
@kemalgoklen kemalgoklen changed the title Output which file changed from files input [Feature] <title> [Feature] <Output which file changed from files input > Dec 22, 2022
@kemalgoklen kemalgoklen changed the title [Feature] <Output which file changed from files input > [Feature] Output which file changed from files input Dec 22, 2022
@github-actions
Copy link
Contributor

Thanks for reporting this issue, don't forget to star this project if you haven't already to help us reach a wider audience.

@jackton1
Copy link
Member

@kemalgoklen Can you provide more information on how you expect the feature to work ?

@kemalgoklen
Copy link
Author

kemalgoklen commented Dec 23, 2022

Hey, @jackton1 sure.

 - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Collect directories that contain terragrunthcl without dependency
        id: get_dirs
        run: |
           echo "$(find staging-acc -type f -name "terragrunt.hcl" -exec grep -R -i -L "dependency" {} \; | uniq)" >> dirs.txt

      - name: Get changed files
        id: changed-files-specific
        uses: tj-actions/changed-files@v34
        with:
          files_from_source_file: dirs.txt
          files_ignore: |
            .github/**
          json: "true"
          dir_names: "true"
      - name: List all changed files
        run: |
          echo "All Changed ${{steps.changed-files-specific.outputs.all_changed_and_modified_files}}"
          echo " Other Changed ${{steps.changed-files-specific.outputs. any_changed}}"

As I mentioned, all changed files return all the changed file's names, and any_changed will return a boolean value based on built dirs.txt.
I expect to get which file changed in the provided source_file instead of getting a boolean value.

@jackton1
Copy link
Member

jackton1 commented Dec 24, 2022

@kemalgoklen I believe that information should already be available using the all_changed_files output.

See this line: https://github.com/tj-actions/changed-files/blob/main/get-changed-paths.sh#L208 which sets any_changed to true or false.

Let me know if you have any other questions as this is already implemented.

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

No branches or pull requests

2 participants