diff --git a/.github/workflows/gen.yml b/.github/workflows/gen.yml index 18b50a5dc..553934b71 100644 --- a/.github/workflows/gen.yml +++ b/.github/workflows/gen.yml @@ -31,7 +31,7 @@ jobs: - name: Check for changes run: | CHANGES=$(git diff-index --name-only HEAD --) - if [ -n $CHANGES ] ; then + if [ -n "$CHANGES" ] ; then echo "There are changes after running gen.sh:" git diff exit 1 diff --git a/.github/workflows/mdformat.yml b/.github/workflows/mdformat.yml new file mode 100644 index 000000000..6393d9f0e --- /dev/null +++ b/.github/workflows/mdformat.yml @@ -0,0 +1,39 @@ +name: "mdformat" + +on: + push: + pull_request: + # The branches below must be a subset of the branches above + schedule: + - cron: "33 1 * * 3" + +jobs: + mdformat: + name: "Markdown format checking" + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: 3.11 + - name: cd and ls + run: | + cd ${{ github.workspace }} + ls -l + - name: Download dependencies + run: | + python -m pip install mdformat + - name: Format .md files + run: | + find . -name '*.md' -print -exec mdformat '{}' \; + - name: Check for changes + run: | + CHANGES=$(git diff-index --name-only HEAD --) + if [ -n "$CHANGES" ] ; then + echo "There are changes after running mdformat:" + git diff + exit 1 + fi