mirror of
https://github.com/TrianguloY/UrlChecker.git
synced 2024-09-19 20:02:16 +02:00
slightly improvement over the validation (now validate-store-files) action
This commit is contained in:
parent
f6cfddce2e
commit
2f5455c007
@ -1,6 +1,9 @@
|
||||
name: Validation
|
||||
# This action checks that the store files are valid for Play Store. Current checks:
|
||||
# - title and description files must not exceed a maximum number of characters
|
||||
# To be replaced with a more powerful (and less manual) one
|
||||
name: Validate store files
|
||||
|
||||
# Note: this is the second time I'm writting a GitHub action, and the first time I'm using a script.
|
||||
# Note: this is the second time I'm writing a GitHub action, and the first time I'm using a script.
|
||||
# Most probably there are better ways to do it, if you know one and want to suggest it that'd be wonderful!
|
||||
|
||||
on:
|
||||
@ -12,8 +15,7 @@ on:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
validate:
|
||||
# This action checks that the title and description files don't exceed the maximum number of characters allowed on PlayStore
|
||||
validation:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@ -54,11 +56,10 @@ jobs:
|
||||
// invalid length, error
|
||||
error = true;
|
||||
console.log(`[ERROR ] - '${file}' length: ${size}/${limit}`);
|
||||
console.error("");
|
||||
console.error("*********");
|
||||
console.error(`* ERROR : File ${file} from locale ${locale} (${subpath}) must have ${limit} or less chars, and has ${size}. Use synonims or remove less important sentences, otherwise Play Store won't accept it`);
|
||||
console.error("*********");
|
||||
console.error("");
|
||||
console.log("");
|
||||
// '[ERROR]' is detected on GitHub and the line is displayed on red
|
||||
console.log(`[ERROR] File ${file} from locale ${locale} (${subpath}) must be ${limit} or less characters long, current length: ${size}. Use synonims or remove less important sentences, otherwise Play Store won't accept it.`);
|
||||
console.log("");
|
||||
}else{
|
||||
// valid length
|
||||
console.log(`[ OK ] - '${file}' length: ${size}/${limit}`);
|
||||
@ -74,10 +75,9 @@ jobs:
|
||||
console.log("");
|
||||
if (error) {
|
||||
// error, exit
|
||||
console.error("Validation finished. Errors found, check above for their details");
|
||||
console.log("Validation finished. Errors found, check above for their details");
|
||||
process.exit(1);
|
||||
}else{
|
||||
// ok, end
|
||||
console.log("Validation finished. No errors found.");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user