GithubHelp home page GithubHelp logo

Comments (6)

jackton1 avatar jackton1 commented on June 14, 2024

Hi @bbaral07 can you provide details of your workflow file. Include sections of both the checkout action and the changed-files action

from changed-files.

jackton1 avatar jackton1 commented on June 14, 2024

Hi @bbaral07 I'll suggest specifying the correct path input if you're checking out the repository in another folder.

You can search for "Get all changed files for a repository located in a different path" in the Examples section.

from changed-files.

bbaral07 avatar bbaral07 commented on June 14, 2024

Hallo Jackton1,
thanks for your reply,
Below is the workflow part, where I do a checkout and then use the tj-actions/changed-files.
I followed the examples, but not sure if I am missing anything. Any hint or help is appreciated.
This is the point where I get the error (as in the original post)

  - name: Repo Checkout
    uses: actions/checkout@v4
    with:
      repository: org/tf_accounts
      ref: 'feature'
      fetch-depth: 0
      clean: 'false'

  - name: List the checkedout folders
    shell: bash
    run: |
      pwd
      ls -al
      printf "\n%s\n" "${GITHUB_WORKSPACE}"

  - name: Get all changed account json files
    id: changed-account-files
    if: contains(fromJson('["push", "pull_request"]'), github.event_name)
    uses: tj-actions/changed-files@v41
    with:
      files: accounts/*.{json}  # Alternatively using: `accounts/**`
      files_ignore: accounts/schema.json
      json: "true"
      write_output_files: true
      path: .

from changed-files.

jackton1 avatar jackton1 commented on June 14, 2024

Hi @bbaral07, thanks for sharing a couple of things to point out.

files: You might want to use accounts/*.json since you donโ€™t need braces here.
path: defaults to . so no need to specify the same value.


Question: Is there a reason you have set clean: 'false'?


Request: To fully get to a solution. Can you include the debug logs of the workflow not a picture or snippet but if possible the entire logs. To obtain the debug logs youโ€™ll need to rerun the workflow and ensure debug logging is enabled prior to rerunning the workflow.

Screenshot 2023-08-31 at 5 51 33 PM

from changed-files.

bbaral07 avatar bbaral07 commented on June 14, 2024

Thanks, Jackton01 for your response.
Sorry for the delayed response.
I tried to hardcode the path, but still, it could not process the result to find the changed files.
I used (clean: 'false') to retain the .git folder as I received an error that it could not find the correct .git folder.
Alternatively, I wrote a short shell script to get the changed files instead of using the action.

Though I could not use it, I truly appreciate the purpose and functionality of this action.
Great Job. ๐Ÿ‘
Maybe I will try in some other workflow.

from changed-files.

jackton1 avatar jackton1 commented on June 14, 2024

Sounds good, FYI the changed-files action doesn't only check that the .git folder exists but also validates the output of

git rev-parse --is-inside-work-tree which should return "true".

If you run into this issue in the future this would help you determine what's wrong.

from changed-files.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.