Skip to content

Commit

Permalink
add .github/workflows/mdformat.yml, fix .github/workflows/gen.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Oct 21, 2023
1 parent 403cae3 commit e6fd494
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/mdformat.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e6fd494

Please sign in to comment.