Stirling-PDF/.github/workflows/update-translations.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

74 lines
2.3 KiB
YAML
Raw Normal View History

2024-12-21 23:40:53 +01:00
name: Update Translations
on:
expand: check language properties (#2724) # Description Improvement in `check_language_properties.py`: Added support for local Windows commands to check language properties files with an updated script. Added a new optional argument `--check-file` to specify a single file to check, replacing the need to process all files in the directory. Adjusted file path handling to better support Windows paths. Update to `update-translations.yml`: Added `workflow_dispatch` trigger to allow manual execution of the workflow. Documentation update in `HowToAddNewLanguage.md`: Added instructions for running the language properties check locally on Windows, including example commands. These changes streamline the process of checking language properties files and provide additional flexibility for local testing and manual workflow triggering. ## Checklist - [x] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [x] I have performed a self-review of my own code - [ ] I have attached images of the change if it is UI based - [x] I have commented my code, particularly in hard-to-understand areas - [ ] If my code has heavily changed functionality I have updated relevant docs on [Stirling-PDFs doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) - [x] My changes generate no new warnings - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only)
2025-01-16 23:03:54 +01:00
workflow_dispatch:
2024-12-21 23:40:53 +01:00
push:
branches: ["main"]
paths:
- "src/main/resources/messages_en_GB.properties"
permissions:
contents: read
2024-12-21 23:40:53 +01:00
jobs:
update-translations-main:
if: github.event_name == 'push'
runs-on: ubuntu-latest
2024-12-21 23:48:09 +01:00
permissions:
contents: write
pull-requests: write
2024-12-21 23:40:53 +01:00
steps:
- name: Harden Runner
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
2024-12-21 23:40:53 +01:00
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: "3.12"
2024-12-21 23:40:53 +01:00
- name: Run Python script to check files
id: run-check
run: |
echo "Running Python script to check files..."
python .github/scripts/check_language_properties.py \
--reference-file src/main/resources/messages_en_GB.properties \
--branch main
- name: Set up git config
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Add translation keys
run: |
git add src/main/resources/messages_*.properties
git diff --staged --quiet || echo "CHANGES_DETECTED=true" >> $GITHUB_ENV
- name: Create Pull Request
id: cpr
if: env.CHANGES_DETECTED == 'true'
Bump peter-evans/create-pull-request from 7.0.5 to 7.0.6 (#2574) Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 7.0.5 to 7.0.6. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/peter-evans/create-pull-request/releases">peter-evans/create-pull-request's releases</a>.</em></p> <blockquote> <h2>Create Pull Request v7.0.6</h2> <p>⚙️ Fixes an issue with commit signing where unicode characters in file paths were not preserved.</p> <h2>What's Changed</h2> <ul> <li>build(deps-dev): bump <code>@​vercel/ncc</code> from 0.38.1 to 0.38.2 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3365">peter-evans/create-pull-request#3365</a></li> <li>Update distribution by <a href="https://github.com/actions-bot"><code>@​actions-bot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3370">peter-evans/create-pull-request#3370</a></li> <li>build(deps): bump <code>@​octokit/plugin-rest-endpoint-methods</code> from 13.2.4 to 13.2.5 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3375">peter-evans/create-pull-request#3375</a></li> <li>build(deps-dev): bump <code>@​types/node</code> from 18.19.50 to 18.19.54 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3376">peter-evans/create-pull-request#3376</a></li> <li>build(deps): bump <code>@​octokit/plugin-paginate-rest</code> from 11.3.3 to 11.3.5 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3377">peter-evans/create-pull-request#3377</a></li> <li>Update distribution by <a href="https://github.com/actions-bot"><code>@​actions-bot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3388">peter-evans/create-pull-request#3388</a></li> <li>build(deps-dev): bump <code>@​types/node</code> from 18.19.54 to 18.19.55 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3400">peter-evans/create-pull-request#3400</a></li> <li>build(deps): bump <code>@​actions/core</code> from 1.10.1 to 1.11.1 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3401">peter-evans/create-pull-request#3401</a></li> <li>build(deps): bump <code>@​octokit/plugin-rest-endpoint-methods</code> from 13.2.5 to 13.2.6 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3403">peter-evans/create-pull-request#3403</a></li> <li>build(deps-dev): bump eslint-plugin-import from 2.30.0 to 2.31.0 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3402">peter-evans/create-pull-request#3402</a></li> <li>build(deps): bump <code>@​octokit/plugin-throttling</code> from 9.3.1 to 9.3.2 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3404">peter-evans/create-pull-request#3404</a></li> <li>Update distribution by <a href="https://github.com/actions-bot"><code>@​actions-bot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3423">peter-evans/create-pull-request#3423</a></li> <li>build(deps-dev): bump typescript from 5.6.2 to 5.6.3 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3441">peter-evans/create-pull-request#3441</a></li> <li>build(deps): bump undici from 6.19.8 to 6.20.1 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3442">peter-evans/create-pull-request#3442</a></li> <li>Update distribution by <a href="https://github.com/actions-bot"><code>@​actions-bot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3451">peter-evans/create-pull-request#3451</a></li> <li>build(deps-dev): bump <code>@​types/node</code> from 18.19.55 to 18.19.58 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3457">peter-evans/create-pull-request#3457</a></li> <li>build(deps-dev): bump <code>@​types/jest</code> from 29.5.13 to 29.5.14 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3462">peter-evans/create-pull-request#3462</a></li> <li>build(deps-dev): bump <code>@​types/node</code> from 18.19.58 to 18.19.60 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3463">peter-evans/create-pull-request#3463</a></li> <li>chore: don't bundle undici by <a href="https://github.com/benmccann"><code>@​benmccann</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3475">peter-evans/create-pull-request#3475</a></li> <li>Update distribution by <a href="https://github.com/actions-bot"><code>@​actions-bot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3478">peter-evans/create-pull-request#3478</a></li> <li>chore: use node-fetch-native support for proxy env vars by <a href="https://github.com/peter-evans"><code>@​peter-evans</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3483">peter-evans/create-pull-request#3483</a></li> <li>build(deps-dev): bump <code>@​types/node</code> from 18.19.60 to 18.19.64 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3488">peter-evans/create-pull-request#3488</a></li> <li>build(deps-dev): bump undici from 6.20.1 to 6.21.0 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3499">peter-evans/create-pull-request#3499</a></li> <li>build(deps-dev): bump <code>@​vercel/ncc</code> from 0.38.2 to 0.38.3 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3500">peter-evans/create-pull-request#3500</a></li> <li>docs: note <code>push-to-repo</code> classic PAT <code>workflow</code> scope requirement by <a href="https://github.com/scop"><code>@​scop</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3511">peter-evans/create-pull-request#3511</a></li> <li>docs: spelling fixes by <a href="https://github.com/scop"><code>@​scop</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3512">peter-evans/create-pull-request#3512</a></li> <li>build(deps-dev): bump typescript from 5.6.3 to 5.7.2 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3516">peter-evans/create-pull-request#3516</a></li> <li>build(deps-dev): bump prettier from 3.3.3 to 3.4.0 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3517">peter-evans/create-pull-request#3517</a></li> <li>build(deps-dev): bump <code>@​types/node</code> from 18.19.64 to 18.19.66 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3518">peter-evans/create-pull-request#3518</a></li> <li>docs(README): clarify that an existing open PR is managed by <a href="https://github.com/caugner"><code>@​caugner</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3498">peter-evans/create-pull-request#3498</a></li> <li>Update distribution by <a href="https://github.com/actions-bot"><code>@​actions-bot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3529">peter-evans/create-pull-request#3529</a></li> <li>build(deps): bump <code>@​octokit/plugin-paginate-rest</code> from 11.3.5 to 11.3.6 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3542">peter-evans/create-pull-request#3542</a></li> <li>build(deps-dev): bump <code>@​types/node</code> from 18.19.66 to 18.19.67 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3543">peter-evans/create-pull-request#3543</a></li> <li>build(deps-dev): bump prettier from 3.4.0 to 3.4.1 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3544">peter-evans/create-pull-request#3544</a></li> <li>build(deps-dev): bump eslint-import-resolver-typescript from 3.6.3 to 3.7.0 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3559">peter-evans/create-pull-request#3559</a></li> <li>build(deps-dev): bump prettier from 3.4.1 to 3.4.2 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3560">peter-evans/create-pull-request#3560</a></li> <li>build(deps-dev): bump <code>@​types/node</code> from 18.19.67 to 18.19.68 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3570">peter-evans/create-pull-request#3570</a></li> <li>build(deps): bump p-limit from 6.1.0 to 6.2.0 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3578">peter-evans/create-pull-request#3578</a></li> <li>Update distribution by <a href="https://github.com/actions-bot"><code>@​actions-bot</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3583">peter-evans/create-pull-request#3583</a></li> <li>fix: preserve unicode in filepaths when commit signing by <a href="https://github.com/peter-evans"><code>@​peter-evans</code></a> in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3588">peter-evans/create-pull-request#3588</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/benmccann"><code>@​benmccann</code></a> made their first contribution in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3475">peter-evans/create-pull-request#3475</a></li> <li><a href="https://github.com/scop"><code>@​scop</code></a> made their first contribution in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3511">peter-evans/create-pull-request#3511</a></li> <li><a href="https://github.com/caugner"><code>@​caugner</code></a> made their first contribution in <a href="https://redirect.github.com/peter-evans/create-pull-request/pull/3498">peter-evans/create-pull-request#3498</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/peter-evans/create-pull-request/commit/67ccf781d68cd99b580ae25a5c18a1cc84ffff1f"><code>67ccf78</code></a> fix: preserve unicode in filepaths when commit signing (<a href="https://redirect.github.com/peter-evans/create-pull-request/issues/3588">#3588</a>)</li> <li><a href="https://github.com/peter-evans/create-pull-request/commit/bb88e27d3f9cc69c8bc689eba126096c6fe3dded"><code>bb88e27</code></a> build: update distribution (<a href="https://redirect.github.com/peter-evans/create-pull-request/issues/3583">#3583</a>)</li> <li><a href="https://github.com/peter-evans/create-pull-request/commit/b378ed537a3374cbb7642141277ace10488f9318"><code>b378ed5</code></a> build(deps): bump p-limit from 6.1.0 to 6.2.0 (<a href="https://redirect.github.com/peter-evans/create-pull-request/issues/3578">#3578</a>)</li> <li><a href="https://github.com/peter-evans/create-pull-request/commit/fa9200e5b4f0d3fe4adc6d4a980fdb27ca333ed2"><code>fa9200e</code></a> build(deps-dev): bump <code>@​types/node</code> from 18.19.67 to 18.19.68 (<a href="https://redirect.github.com/peter-evans/create-pull-request/issues/3570">#3570</a>)</li> <li><a href="https://github.com/peter-evans/create-pull-request/commit/16e0059bfd236716f0191bfcfa63d9ded4cf325f"><code>16e0059</code></a> build(deps-dev): bump prettier from 3.4.1 to 3.4.2 (<a href="https://redirect.github.com/peter-evans/create-pull-request/issues/3560">#3560</a>)</li> <li><a href="https://github.com/peter-evans/create-pull-request/commit/5bffd5ae80c9e3cdce3fdaba74ba437193643add"><code>5bffd5a</code></a> build(deps-dev): bump eslint-import-resolver-typescript (<a href="https://redirect.github.com/peter-evans/create-pull-request/issues/3559">#3559</a>)</li> <li><a href="https://github.com/peter-evans/create-pull-request/commit/a22a0ddc2127a4161a9f144623d1e51be98d81aa"><code>a22a0dd</code></a> build(deps-dev): bump prettier from 3.4.0 to 3.4.1 (<a href="https://redirect.github.com/peter-evans/create-pull-request/issues/3544">#3544</a>)</li> <li><a href="https://github.com/peter-evans/create-pull-request/commit/b27ce378c8a71596550fb729c05c9a998f8ff26f"><code>b27ce37</code></a> build(deps-dev): bump <code>@​types/node</code> from 18.19.66 to 18.19.67 (<a href="https://redirect.github.com/peter-evans/create-pull-request/issues/3543">#3543</a>)</li> <li><a href="https://github.com/peter-evans/create-pull-request/commit/4e0cc19e22f9071762b3542aa9fa90a1d682dd32"><code>4e0cc19</code></a> build(deps): bump <code>@​octokit/plugin-paginate-rest</code> from 11.3.5 to 11.3.6 (<a href="https://redirect.github.com/peter-evans/create-pull-request/issues/3542">#3542</a>)</li> <li><a href="https://github.com/peter-evans/create-pull-request/commit/25b6871a4ebe4c3585f47c7a687ac6fd0ec0e32d"><code>25b6871</code></a> docs: update scopes for push-to-fork</li> <li>Additional commits viewable in <a href="https://github.com/peter-evans/create-pull-request/compare/5e914681df9dc83aa4e4905692ca88beb2f9e91f...67ccf781d68cd99b580ae25a5c18a1cc84ffff1f">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=peter-evans/create-pull-request&package-manager=github_actions&previous-version=7.0.5&new-version=7.0.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-02 15:24:04 +01:00
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
2024-12-21 23:40:53 +01:00
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Update translation files"
committer: GitHub Action <action@github.com>
author: GitHub Action <action@github.com>
signoff: true
branch: update_translation_files
title: "Update translation files"
add-paths: |
src/main/resources/messages_*.properties
body: |
Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
draft: false
delete-branch: true
labels: Translation,github-actions
2024-12-21 23:40:53 +01:00
sign-commits: true