sphinx-doc / sphinx-doc-translations

Translations for Sphinx's documentation
Other
22 stars 16 forks source link

Only add directories with changed files #22

Closed jdillard closed 8 months ago

jdillard commented 12 months ago

The Transifex CLI install adds some helper files (README.md and LICENCE at this point in time) that were getting added in git add ., when they shouldn't be added.

Summary of changes

AA-Turner commented 12 months ago

Could we make the second commit standalone?

A

jdillard commented 12 months ago

As in a separate PR?

AA-Turner commented 12 months ago

Oh, the auto-update commit restored it. Perhaps that needs updating?

A

jdillard commented 12 months ago

The workflow didn't necessarily "restore" the old README.md, but this install step also installs README.md and LICENCE files: https://github.com/sphinx-doc/sphinx-doc-translations/blob/3e964f79681ad2c2d11ebcd8e966f62f18c549e9/.github/workflows/main.yml#L50

The reason they weren't added before is install.sh didn't download those two files because they already existed in the repo, now that README.md no longer exists, it was getting downloaded and added in git add .

This PR fixes that by changing the git add behavior and removing the README.md that shouldn't have been added,

rffontenelle commented 11 months ago

Another solution is to run installation in another directory with working-directory option. Since the installer adds the download path to PATH, tx will be available from now on without the LICENSE, README.md and any other in the filter.

   - name: Install Transifex CLI
      working-directory: /usr/local/bin
      run: |
        curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
        tx --version

The tx --version I use to version its version in the workflow run logs, but feel free to ignore that line.