From d4ae8279dce007eed03072b9492603333d45d3c8 Mon Sep 17 00:00:00 2001 From: Rom1-B <8530352+Rom1-B@users.noreply.github.com> Date: Fri, 4 Dec 2026 11:41:03 +0100 Subject: [PATCH] Feat: close pull requests editing translations directly --- README.md | 1 + sync/files/.github/workflows/locales-guard.yml | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 sync/files/.github/workflows/locales-guard.yml diff --git a/README.md b/README.md index 9cfe558..77224ac 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Files in `sync/files/` are pushed through a pull request to every non archived r Files in `sync/files-public/` are pushed the same way to public repositories only, and removed from private ones. After each successful run of the automatic tag workflow, the synced `open-xml-update-pr.yml` workflow opens a pull request copying the `` block of the matching tag's plugin XML (`plugin.xml` or `.xml`) to the default branch, with the `GLPI_PROJECT_BOT` GitHub App, which needs the pull requests write permission; the pull request is assigned to the author of the merged pull request that bumped the version. Issues labelled `need feedback` are closed by the stale workflow after 44 days without activity; the synced `need-feedback.yml` workflow removes the label when the issue author comments. +Pull requests modifying translation files (`locales/*.po` or `locales/*.mo`) are closed by the synced `locales-guard.yml` workflow when the repository has a `.tx/config` file, since Transifex overwrites them; the `i18n-updates*` branches of the translation sync are allowed. Repository settings in `sync/settings.json` (any field of the [update a repository](https://docs.github.com/rest/repos/repos#update-a-repository) API) are applied directly to the same repositories, along with release immutability, Dependabot alerts and security updates, and private vulnerability reporting, secret scanning and push protection (public repositories only). The protection of the default branch and of `X.Y/bugfixes` branches is aligned on `sync/branch-protection.json` (body of the [update branch protection](https://docs.github.com/rest/branches/branch-protection#update-branch-protection) API). Labels in `sync/labels.json` (`name`, `color` and `description`) are created, or updated when their color or description differs; other labels of the repositories are kept. diff --git a/sync/files/.github/workflows/locales-guard.yml b/sync/files/.github/workflows/locales-guard.yml new file mode 100644 index 0000000..aca08ea --- /dev/null +++ b/sync/files/.github/workflows/locales-guard.yml @@ -0,0 +1,17 @@ +name: "Locales guard" + +on: + pull_request_target: + types: + - "opened" + - "reopened" + - "synchronize" + +jobs: + transifex-locales-guard: + name: "Locales guard" + if: github.repository == 'pluginsGLPI/{PLUGIN}' + permissions: + contents: "read" + pull-requests: "write" + uses: "glpi-project/plugin-translation-workflows/.github/workflows/transifex-locales-guard.yml@v1"