Chore/fix openai update #80
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Validate Markdown | |
on: | |
# Trigger the workflow on pull request | |
pull_request_target: | |
branches: | |
- main | |
paths: | |
- '**.md' | |
- '**.ipynb' | |
permissions: | |
contents: read | |
id-token: write | |
issues: write | |
pull-requests: write | |
jobs: | |
check-broken-paths: | |
name: Check Broken Relative Paths | |
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 broken paths | |
run: | | |
BROKEN_PATHS=$(python ./.github/markdown_checker.py --dir './' --func 'check_broken_paths') | |
echo "BROKEN_PATHS<<EOF" >> $GITHUB_ENV | |
echo "$BROKEN_PATHS" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- name: Leave broken paths comment | |
if: ${{ env.BROKEN_PATHS != '' }} | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: ` | |
We have automatically detected the following broken relative paths in your lessons. | |
Please check the file paths and associated broken paths inside them. | |
Learn more from our [contributing guide](https://github.com/microsoft/generative-ai-for-beginners/blob/main/CONTRIBUTING.md). | |
# Check Broken Paths | |
${{ env.BROKEN_PATHS }} | |
` | |
}) | |
- name: Update workflow run status | |
if: ${{ env.BROKEN_PATHS != '' }} | |
run: exit 1 | |
check-paths-tracking: | |
if: ${{ always() }} | |
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') | |
echo "PATHS_TRACKING<<EOF" >> $GITHUB_ENV | |
echo "$PATHS_TRACKING" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- name: Leave paths tracking comment | |
if: ${{ env.PATHS_TRACKING != '' }} | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: ` | |
We have automatically detected missing tracking id from the following relative paths in your lessons. | |
Please check the file paths and associated paths inside them. | |
Learn more from our [contributing guide](https://github.com/microsoft/generative-ai-for-beginners/blob/main/CONTRIBUTING.md). | |
# Check Missing Tracking from Paths | |
${{ env.PATHS_TRACKING }} | |
` | |
}) | |
- name: Update workflow run status | |
if: ${{ env.PATHS_TRACKING != '' }} | |
run: exit 1 | |
check-urls-tracking: | |
if: ${{ always() }} | |
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') | |
echo "URLS_TRACKING<<EOF" >> $GITHUB_ENV | |
echo "$URLS_TRACKING" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- name: Leave URLs tracking comment | |
if: ${{ env.URLS_TRACKING != '' }} | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: ` | |
We have automatically detected missing tracking id from the following URLs in your lessons. | |
Please check the file paths and associated URLs inside them. | |
Learn more from our [contributing guide](https://github.com/microsoft/generative-ai-for-beginners/blob/main/CONTRIBUTING.md). | |
# Check Missing Tracking from URLs | |
${{ env.URLS_TRACKING }} | |
` | |
}) | |
- name: Update workflow run status | |
if: ${{ env.URLS_TRACKING != '' }} | |
run: exit 1 | |
check-urls-locale: | |
if: ${{ always() }} | |
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') | |
echo "URLS_LOCALE<<EOF" >> $GITHUB_ENV | |
echo "$URLS_LOCALE" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- name: Leave URLs locale comment | |
if: ${{ env.URLS_LOCALE != '' }} | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: ` | |
We have automatically detected added country locale to URLs in your lessons. | |
Please check the file paths and associated URLs inside them. | |
Learn more from our [contributing guide](https://github.com/microsoft/generative-ai-for-beginners/blob/main/CONTRIBUTING.md). | |
# Check Country Locale in URLs | |
${{ env.URLS_LOCALE }} | |
` | |
}) | |
- name: Update workflow run status | |
if: ${{ env.URLS_LOCALE != '' }} | |
run: exit 1 |