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

fatal: pathspec 'other/*.json' did not match any files #10

Open
dewey opened this issue Feb 19, 2025 · 9 comments
Open

fatal: pathspec 'other/*.json' did not match any files #10

dewey opened this issue Feb 19, 2025 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@dewey
Copy link

dewey commented Feb 19, 2025

Hey—

I'm running the following GitHub Action and I'm running into the error below. The keys on Lokalise have a file assigned, and the "other" and "web" folder were created in my repository.

Do you have a pointer on where it's going wrong there?

Thanks!

Switched to a new branch 'lok_active_ffde7f_1739979125'
fatal: pathspec 'other/*.json' did not match any files
Error: failed to add files: exit status 128
Error: commit_changes script failed with exit code 1

Image

      - name: Pull from Lokalise
        id: lokalise-pull
        uses: lokalise/lokalise-pull-action@v3.2.0
        with:
          api_token: ${{ secrets.LOKALISE_API_TOKEN }}
          project_id: <redacted>
          base_lang: "en"
          translations_path: |
            web
            other
          file_format: "json"
          always_pull_base: "true"
          flat_naming: "true"

Image

@dewey
Copy link
Author

dewey commented Feb 19, 2025

Turns out I needed to create a single en.json file in my web and other directory. Would be cool if the Action could deal with a cold-start in an empty repository (Even creating the directories based on the provided translations_path configuration would be great.

@bodrovis
Copy link
Collaborator

Good day! That's an interesting edge case, I'll look into it 👍

@bodrovis bodrovis self-assigned this Feb 19, 2025
@bodrovis bodrovis added the enhancement New feature or request label Feb 19, 2025
@dewey
Copy link
Author

dewey commented Feb 19, 2025

Thanks, you are always reacting extremely fast, much appreciated! I've noticed that this strategy of adding a "en.json" file worked for my "web" directory, but not the "other" platform / directory. Even though the configuration is the same. Not sure what is going wrong there.

Image

Image

@bodrovis
Copy link
Collaborator

bodrovis commented Feb 19, 2025

I might have a clue of what's going on. 🤔 If a key is assigned to the "Other" platform on Lokalise, it won't be exported when the JSON file format is requested (file_format: "json" config part) because JSON is related to the "Web" platform only. The "pathspec did not match any files" also kind of suggests there were no JSON files found.

One potential solution is to enable the all_platforms setting, for example additional_params: "--all_platforms" in the config. As mentioned in the API docs, "all_platforms — Enable to include all platform keys. If disabled, only the keys, associated with the platform of the format will be exported.".

Well, alternatively the key might be assigned to multiple platforms.

Hopefully it solves the issue!

/cc @amira-lok

@dewey
Copy link
Author

dewey commented Feb 19, 2025

Thanks, I've tried the all-platforms additional params now, but unfortunately it doesn't seem to work. I'm then just getting the following output where it can't find any difference to the repository.

Lokalise CLI installed successfully.
Lokalise CLI version: lokalise2 version 3.0.1
Run set -e
Starting download from Lokalise
Attempt 1 of 3
Successfully downloaded files.
No changes detected in translation files.
Run if [ "" != "true" ]; then

It's a bit misleading if the file linked to the "Other" platform on Lokalise itself is a json and then the download tool or Action exclude it by default.

PS: There's an inconsistency in the all_platforms flag. In your comment and on this article it's all_platforms but in the Lokalise CLI it's all-platforms. I've tried both but it didn't change anything.

Usage:
  lokalise2 file download [flags]

Flags:
      --all-platforms

@dewey
Copy link
Author

dewey commented Feb 20, 2025

I wonder if it's related to the fact that I could "fix" the web key by adding a empty en.json file into the directory, maybe similar to what @bodrovis mentioned the default file that I'd need to create would be the native one for the "other" platform?

In this case I'd want both of them to be other/%LANG_ISO%.json and other/%LANG_ISO%.json though.

@bodrovis
Copy link
Collaborator

Yep, sorry it should be all-platforms! We're looking into it with the team, I hope to share some insights soon

@amira-lok
Copy link

@dewey , would you mind getting in touch with us through Intercom? I will pick up the case there and will help you, ok? I think it is better to do it over there.

@bodrovis
Copy link
Collaborator

Okay, so I can see this on Intercom, we'll try to resolve this asap

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

3 participants