Update generate_markdown.yml #27
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: Generate Markdown | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
tags: | |
- docs | |
jobs: | |
generate_markdown: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Check for docs tag | |
id: check-tag | |
run: | | |
TAG_PRESENT=$(git tag --contains HEAD | grep -c "docs") | |
echo "::set-output name=tag_present::$TAG_PRESENT" | |
- name: Run Job if Tag is Present | |
if: steps.check-tag.outputs.tag_present == '1' | |
run: | | |
echo "Running job because 'docs' tag is present on the latest commit in main." | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install PyYAML | |
- name: Generate Markdown | |
run: | | |
python .github/generate_markdown.py | |
- name: Archive artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: markdown-artifact | |
path: .github/output.md | |
- name: Trigger Repository Dispatch | |
run: | | |
curl -X POST \ | |
-H "Accept: application/vnd.github.everest-preview+json" \ | |
-H "Authorization: token ${{ secrets.CROSS_REPO_TRIGGER }}" \ | |
https://api.github.com/repos/thutuva/copy-docs/dispatches \ | |
-d '{"event_type": "triggered_from_repo_a"}' |