fix path in `set_docs_to_build`

This commit is contained in:
MicroDev 2023-01-08 13:23:51 +05:30
parent 722a313cc1
commit 565bbd5002
No known key found for this signature in database
GPG Key ID: 2C0867BE60967730
1 changed files with 3 additions and 1 deletions

View File

@ -238,11 +238,13 @@ def set_docs_to_build(build_all):
doc_pattern = re.compile(
r"^(?:.github/workflows/|docs|extmod/ulab|(?:(?:ports/\w+/bindings|shared-bindings)\S+\.c|conf\.py|tools/extract_pyi\.py|requirements-doc\.txt)$)|(?:-stubs|\.(?:md|MD|rst|RST))$"
)
github_workspace = os.environ.get("GITHUB_WORKSPACE") or ""
github_workspace = github_workspace and github_workspace + "/"
for p in changed_files:
if (
p.endswith(".c")
and not subprocess.run(
f"git diff -U0 {os.environ.get('BASE_SHA')}...{os.environ.get('HEAD_SHA')} {p} | grep -o -m 1 '^[+-]\/\/|'",
f"git diff -U0 $BASE_SHA...$HEAD_SHA {github_workspace + p} | grep -o -m 1 '^[+-]\/\/|'",
capture_output=True,
shell=True,
).stdout