updated gist-sync.yaml #69
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
# | |
# Author: Hari Sekhon | |
# Date: 2024-02-27 18:45:11 +0000 (Tue, 27 Feb 2024) | |
# | |
# vim:ts=2:sts=2:sw=2:et | |
# | |
# https://github.com/HariSekhon/Docs | |
# | |
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback | |
# | |
# https://www.linkedin.com/in/HariSekhon | |
# | |
# ============================================================================ # | |
# M a r k d o w n R e f e r e n c e s | |
# ============================================================================ # | |
# Check all .md file references exist | |
--- | |
name: Markdown References | |
on: | |
push: | |
branches: | |
- master | |
- main | |
paths: | |
- '**/*.md' | |
- .github/workflows/markdown_references.yaml | |
pull_request: | |
branches: | |
- master | |
- main | |
paths: | |
- '**/*.md' | |
- .github/workflows/markdown_references.yaml | |
workflow_dispatch: | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash -euo pipefail {0} | |
jobs: | |
markdown-references: | |
# github.event.repository context not available in scheduled workflows | |
#if: github.event.repository.fork == false | |
if: github.repository_owner == 'HariSekhon' | |
name: References Check | |
timeout-minutes: 3 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
#name: Git Checkout # better to show the action@version | |
- name: Check all *.md are in the README.md | |
run: | | |
exitcode=0 | |
for file_md in $(git grep -Eoh --max-depth 1 '\([[:alnum:]_-]+\.md' | sed 's/^(//' | sort -u); do | |
if ! [ -f "$file_md" ]; then | |
echo "referenced but file not found: $file_md" | |
exitcode=1 | |
fi | |
done | |
exit $exitcode |