mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-23 20:29:06 -05:00
fix: give fork pull requests the hash report
A fork's GITHUB_TOKEN is read-only, so the comment never arrived and a valid file turned red. The report now goes to the job summary for every pull request, and the comment and labels run only where the token can write. validate_pr points an oversized file to an issue instead of a platform setting a contributor cannot use.
This commit is contained in:
1 parent
348c56e94c
commit
621f4fcdee
4 files changed
+157
-5
No files matched your search
@@ -61,6 +61,9 @@ BLOCKED_EXTENSIONS = {
|
||||
}
|
||||
|
||||
MAX_FILE_SIZE = 100 * 1024 * 1024
|
||||
LARGE_FILE_ISSUE_URL = (
|
||||
"https://github.com/Abdess/retrobios/issues/new?template=missing-bios.yml"
|
||||
)
|
||||
|
||||
|
||||
class ValidationResult:
|
||||
@@ -259,9 +262,14 @@ def validate_file(
|
||||
result.add_check(False, f"Blocked file extension: {ext}")
|
||||
|
||||
if result.size > MAX_FILE_SIZE:
|
||||
# GitHub refuses a pushed file over 100 MiB, so a pull request cannot
|
||||
# carry it. Only a maintainer can add an asset to the release.
|
||||
result.add_check(
|
||||
False,
|
||||
f"File too large for embedded storage ({result.size:,} > {MAX_FILE_SIZE:,} bytes). Use storage: external in platform config.",
|
||||
f"File too large for git ({result.size:,} > {MAX_FILE_SIZE:,} bytes). "
|
||||
"Leave it out of the pull request and open an issue "
|
||||
f"({LARGE_FILE_ISSUE_URL}) with the hashes above and where the file "
|
||||
"can be obtained: a maintainer adds it to the `large-files` release.",
|
||||
)
|
||||
elif result.size == 0:
|
||||
result.add_check(False, "File is empty (0 bytes)")
|
||||
|
||||
Reference in new issue
Block a user