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:
parent
8b386e6e84
commit
cf832ffef4
2 changed files with 19 additions and 2 deletions
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",
|
"fedrunov",
|
||||||
"Florian14",
|
"Florian14",
|
||||||
"ganfra",
|
"ganfra",
|
||||||
|
"github-actions[bot]",
|
||||||
"jmartinesp",
|
"jmartinesp",
|
||||||
"jonnyandrew",
|
"jonnyandrew",
|
||||||
"kittykat",
|
"kittykat",
|
||||||
|
|
@ -116,8 +117,18 @@ if (github.requested_reviewers.users.length == 0 && !pr.draft) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that translations have not been modified by developers
|
// 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"))) {
|
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.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue