mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-01 19:11:15 +00:00
45 lines
1.4 KiB
YAML
45 lines
1.4 KiB
YAML
name: "Check validity of .editorconfig"
|
|
|
|
permissions: read-all
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
jobs:
|
|
check-editorconfig:
|
|
runs-on: ubuntu-latest
|
|
if: "!contains(github.event.pull_request.title, '[skip ci]')"
|
|
steps:
|
|
- name: Get list of changed files from PR
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
gh api \
|
|
repos/notashelf/neovim-flake/pulls/${{github.event.number}}/files --paginate \
|
|
| jq '.[] | select(.status != "removed") | .filename' \
|
|
> "$HOME/changed_files"
|
|
|
|
- name: Print list of changed files
|
|
run: |
|
|
cat "$HOME/changed_files"
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
|
|
|
- name: Install Nix
|
|
uses: DeterminateSystems/nix-installer-action@main
|
|
- uses: DeterminateSystems/magic-nix-cache-action@main
|
|
|
|
- name: Checking EditorConfig
|
|
run: |
|
|
cat "$HOME/changed_files" | nix-shell -p editorconfig-checker.out --run 'xargs -r editorconfig-checker -disable-indent-size'
|
|
|
|
- if: ${{ failure() }}
|
|
shell: bash
|
|
run: |
|
|
echo "::error:: Current formatting does not fit convention provided by .editorconfig located in the project root."
|
|
echo "Please make sure your editor properly integrates editorconfig. See https://editorconfig.org/#download for more."
|
|
exit 1
|