Skip to content

Commit

Permalink
Merge pull request microsoft#127 from john0isaac/fix-workflow-flaws
Browse files Browse the repository at this point in the history
fix: workflow flaws
  • Loading branch information
leestott authored Nov 8, 2023
2 parents 5cb4329 + dfa03d0 commit dea3e89
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 7 additions & 1 deletion .github/markdown_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,13 @@ def get_lessons_paths(root_path: str) -> dict:
# check for translations directories
if os.path.isdir(os.path.join(root_path, lesson, item)):
for sub_item in os.listdir(os.path.join(root_path, lesson, item)):
if os.path.isdir(os.path.join(root_path, lesson, item, sub_item)):
for sub_item2 in os.listdir(os.path.join(root_path, lesson, item, sub_item)):
# check for .md and .ipynb files and store them
if sub_item2.lower().endswith(('.md', '.ipynb')):
lessons[lesson].append(os.path.join(item, sub_item, sub_item2))
# check for .md and .ipynb files and store them
if sub_item.lower().endswith(('.md', '.ipynb')):
elif sub_item.lower().endswith(('.md', '.ipynb')):
lessons[lesson].append(os.path.join(item, sub_item))
# check for .md and .ipynb files and store them
elif item.lower().endswith(('.md', '.ipynb')):
Expand Down Expand Up @@ -145,6 +150,7 @@ def get_paths_from_links(all_links: list) -> list:
path_pattern = re.compile(r'(\.{1,2}\/)+([A-Za-z0-9-]+\/)*(.+\.[A-Za-z]+)')

for link in all_links:
link = link.split(" ")[0]
matches = re.findall(path_pattern, link)
if matches:
paths.append(link)
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/check-markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
Expand Down

0 comments on commit dea3e89

Please sign in to comment.