github-action icon indicating copy to clipboard operation
github-action copied to clipboard

Error using the 'upload sources' to upload a single file with no config

Open jasonleenaylor opened this issue 3 years ago • 3 comments

When using the Github action to upload a single source file I receive an error: "No sources found for 'home/runner/work/libpalaso/libpalaso/Palaso.en.xlf' pattern. Check the source paths in your configuration file"

To Reproduce This is the relevant part of our github action. I've verified that the file exists where the action expects it to be and that the -t argument matches the pattern in 'Resulting file after translations export:'

    - name: Upload Source Strings To Crowdin
      uses: crowdin/github-action@ecd7eb0ef6f3cfa16293c79e9cbc4bc5b5fd9c49
      with:
        upload_sources: true
        upload_sources_args: '-s /home/runner/work/libpalaso/libpalaso/Palaso.en.xlf -t /%local%/Palaso.%locale%.xlf -T ${{ secrets.CROWDIN_ACCESS_TOKEN }} -i ${{ secrets.CROWDIN_PROJECT_ID }}'
        push_translations: false
        create_pull_request: false

I expected the action to upload the file. I can see that the version 2 API is being used by the action, but it fails to upload the updated source file.

jasonleenaylor avatar Jun 06 '22 22:06 jasonleenaylor

I tried many different options including using a config file instead but I could not get the upload sources in the action to work with my project. I changed my action to install and use the CLI instead and got things working, but only if I ran it on Windows. Is there some sort of escaping needed for the %locale% variable to work on Linux?

jasonleenaylor avatar Jun 07 '22 15:06 jasonleenaylor

Hi @jasonleenaylor!

Could you please try to configure the source and translation patterns using the crowdin.yml configuration file?

We are trying to investigate what is wrong with the -s and -t parameters and this may take some time. There shouldn't be any difference between Linux and Windows environments

andrii-bodnar avatar Jun 07 '22 15:06 andrii-bodnar

Thank you @andrii-bodnar I did try that (but I may not have had everything quite right). I won't be able to try today and I have it working with the CLI for now, so I'm not in a rush.

jasonleenaylor avatar Jun 07 '22 15:06 jasonleenaylor