Add nanorc files parsing in checks workflow #11
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: Pull request checks | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
check_nanorc_files: | |
name: Check nanorc files | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v3 | |
- name: Parse nanorc files | |
run: | | |
# see https://www.nano-editor.org/dist/latest/nano.html#Nanorc-Files | |
grep -v -E "^(#|syntax|header|magic|formatter|linter|comment|tabgives|color|icolor|include|extendsyntax|$)" *.nanorc && exit 1 || exit 0 | |
- name: Run nano | |
shell: bash | |
run: | | |
nano --version | |
echo "include \"$(pwd)/*.nanorc\"" > ~/.nanorc | |
echo "" | nano 2> log.txt || grep "^Error" log.txt && exit 1 || exit 0 |