Allow user github-actions[bot] to update translations.
Check that new strings are not added to `values/strings.xml` Signoff not required for "github-actions[bot]" user.
This commit is contained in:
committed by
Benoit Marty
parent
da3bc901a9
commit
19f2310191
6
libraries/ui-strings/src/main/res/values/strings_eax.xml
Normal file
6
libraries/ui-strings/src/main/res/values/strings_eax.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!-- Add new strings for Element X Android here -->
|
||||
|
||||
</resources>
|
||||
@@ -74,6 +74,7 @@ const allowList = [
|
||||
"fedrunov",
|
||||
"Florian14",
|
||||
"ganfra",
|
||||
"github-actions[bot]",
|
||||
"jmartinesp",
|
||||
"jonnyandrew",
|
||||
"kittykat",
|
||||
@@ -116,8 +117,18 @@ if (github.requested_reviewers.users.length == 0 && !pr.draft) {
|
||||
}
|
||||
|
||||
// Check that translations have not been modified by developers
|
||||
if (user != "RiotTranslateBot") {
|
||||
const translationAllowList = [
|
||||
"RiotTranslateBot",
|
||||
"github-actions[bot]",
|
||||
]
|
||||
|
||||
if (!translationAllowList.includes(user)) {
|
||||
if (editedFiles.some(file => file.endsWith("strings.xml") && !file.endsWith("values/strings.xml"))) {
|
||||
fail("Some translation files have been edited. Only user `RiotTranslateBot` (i.e. translations coming from Weblate) is allowed to do that.\nPlease read more about translations management [in the doc](https://github.com/vector-im/element-android/blob/develop/CONTRIBUTING.md#internationalisation).")
|
||||
fail("Some translation files have been edited. Only user `RiotTranslateBot` (i.e. translations coming from Weblate) or `github-actions[bot]` (i.e. translations coming from automation) are allowed to do that.\nPlease read more about translations management [in the doc](https://github.com/vector-im/element-android/blob/develop/CONTRIBUTING.md#internationalisation).")
|
||||
}
|
||||
|
||||
// Check that new strings are not added to `values/strings.xml`
|
||||
if (editedFiles.some(file => file.endsWith("ui-strings/src/main/res/values/strings.xml"))) {
|
||||
fail("`ui-strings/src/main/res/values/strings.xml` has been edited. This file will be overridden in the next strings synchronisation. Please add new strings in the file `values/strings_eax.xml` instead.")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user