magicard-cups-driver: init at 1.4.0 (#338852)
[NixPkgs.git] / .github / workflows / editorconfig.yml
blob26530f30f4683fd705a30202377717c6cecc2100
1 name: "Checking EditorConfig"
3 permissions: read-all
5 on:
6   # avoids approving first time contributors
7   pull_request_target:
8     branches-ignore:
9       - 'release-**'
11 jobs:
12   tests:
13     name: editorconfig-check
14     runs-on: ubuntu-latest
15     if: "github.repository_owner == 'NixOS' && !contains(github.event.pull_request.title, '[skip treewide]')"
16     steps:
17     - name: Get list of changed files from PR
18       env:
19         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20       run: |
21         gh api \
22           repos/NixOS/nixpkgs/pulls/${{github.event.number}}/files --paginate \
23           | jq '.[] | select(.status != "removed") | .filename' \
24           > "$HOME/changed_files"
25     - name: print list of changed files
26       run: |
27         cat "$HOME/changed_files"
28     - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
29       with:
30         # pull_request_target checks out the base branch by default
31         ref: refs/pull/${{ github.event.pull_request.number }}/merge
32     - uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
33       with:
34         # nixpkgs commit is pinned so that it doesn't break
35         # editorconfig-checker 2.4.0
36         nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/c473cc8714710179df205b153f4e9fa007107ff9.tar.gz
37     - name: Checking EditorConfig
38       run: |
39         cat "$HOME/changed_files" | nix-shell -p editorconfig-checker --run 'xargs -r editorconfig-checker -disable-indent-size'
40     - if: ${{ failure() }}
41       run: |
42         echo "::error :: Hey! It looks like your changes don't follow our editorconfig settings. Read https://editorconfig.org/#download to configure your editor so you never see this error again."