Fix links to documentation (#515) #298
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update translations | |
| on: | |
| pull_request: | |
| paths: | |
| - '_translations/**' | |
| push: | |
| branches: [ "master" ] | |
| paths: | |
| - '_translations/**' | |
| - 'src/**' | |
| permissions: | |
| contents: read # Required to check out repository contents by default. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| update-docs: | |
| name: Update docs | |
| permissions: | |
| contents: write # Required to push generated translation updates. | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| token: ${{ secrets.YIISOFT_GITHUB_TOKEN || github.token }} | |
| ref: ${{ github.head_ref }} | |
| repository: ${{ github.event.pull_request.head.repo.full_name }} | |
| persist-credentials: false | |
| - name: Prepare po4a configuration | |
| run: _translations/prepare-config.sh | |
| - name: Use po4a | |
| uses: vjik/docker-run@623c9adf6ee99fc8f9fa4e3b0b6b0c25859b69ee # v1 | |
| with: | |
| image: ghcr.io/yiisoft-contrib/po4a:0.74 | |
| volumes: ${{ github.workspace }}:/src | |
| workdir: /src/_translations | |
| command: po4a po4a.conf && po4a po4a.conf | |
| - name: Configure Git credentials | |
| env: | |
| GH_TOKEN: ${{ secrets.YIISOFT_GITHUB_TOKEN || github.token }} | |
| run: git config --global credential.helper '!f() { echo username=x-access-token; echo password=$GH_TOKEN; }; f' | |
| - name: Commit changed files | |
| env: | |
| GIT_AUTHOR_NAME: github-actions[bot] | |
| GIT_AUTHOR_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com | |
| GIT_COMMITTER_NAME: github-actions[bot] | |
| GIT_COMMITTER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com | |
| run: | | |
| git add _translations src | |
| if git diff --cached --quiet; then | |
| echo "No translation changes to commit." | |
| exit 0 | |
| fi | |
| git commit -m "Update translation" | |
| git push |