Skip to content

Commit

Permalink
Merge pull request microsoft#152 from john0isaac/improve-workflow
Browse files Browse the repository at this point in the history
Improve workflow
  • Loading branch information
leestott authored Nov 9, 2023
2 parents 2bba998 + cdb3fc5 commit aa7e119
Showing 1 changed file with 61 additions and 4 deletions.
65 changes: 61 additions & 4 deletions .github/workflows/validate-markdown.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Validate Markdown

on:
# Trigger the workflow on push or pull request
# Trigger the workflow on pull request
pull_request_target:
branches:
- main
Expand All @@ -16,7 +16,8 @@ permissions:
pull-requests: write

jobs:
check-broken-links-job:
check-broken-paths:
name: Check Broken Relative Paths
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
Expand Down Expand Up @@ -53,7 +54,26 @@ jobs:
${{ env.BROKEN_PATHS }}
`
})
- name: Update workflow run status
if: ${{ env.BROKEN_PATHS != '' }}
run: exit 1

check-paths-tracking:
needs: check-broken-paths
name: Check Paths Have Tracking
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
- name: Run Check paths tracking
run: |
PATHS_TRACKING=$(python ./.github/markdown_checker.py --dir './' --func 'check_paths_tracking')
Expand All @@ -77,7 +97,26 @@ jobs:
${{ env.PATHS_TRACKING }}
`
})
- name: Update workflow run status
if: ${{ env.PATHS_TRACKING != '' }}
run: exit 1

check-urls-tracking:
needs: check-paths-tracking
name: Check URLs Have Tracking
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
- name: Run Check URLs tracking
run: |
URLS_TRACKING=$(python ./.github/markdown_checker.py --dir './' --func 'check_urls_tracking')
Expand All @@ -101,7 +140,26 @@ jobs:
${{ env.URLS_TRACKING }}
`
})
- name: Update workflow run status
if: ${{ env.URLS_TRACKING != '' }}
run: exit 1

check-urls-locale:
needs: check-urls-tracking
name: Check URLs Don't Have Locale
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
- name: Run Check URLs Country Locale
run: |
URLS_LOCALE=$(python ./.github/markdown_checker.py --dir './' --func 'check_urls_locale')
Expand All @@ -125,7 +183,6 @@ jobs:
${{ env.URLS_LOCALE }}
`
})
- name: Update workflow run status
if: ${{ env.BROKEN_PATHS != '' }} || ${{ env.PATHS_TRACKING != '' }} || ${{ env.URLS_TRACKING != '' }} || ${{ env.URLS_LOCALE != '' }}
if: ${{ env.URLS_LOCALE != '' }}
run: exit 1

0 comments on commit aa7e119

Please sign in to comment.