@@ -1,7 +1,9 @@
11name: "Checking EditorConfig"
22
3+permissions: read-all
4+
35on:
4− pull_request:
6+ pull_request_target:
57 branches-ignore:
68 - 'release-**'
79
@@ -21,17 +23,19 @@ jobs:
2123 >> $GITHUB_ENV
2224 echo 'EOF' >> $GITHUB_ENV
2325 - uses: actions/checkout@v2
26+ with:
27+ # pull_request_target checks out the base branch by default
28+ ref: refs/pull/${{ github.event.pull_request.number }}/merge
2429 if: env.PR_DIFF
25− - name: Fetch editorconfig-checker
30+ - uses: cachix/install-nix-action@v13
2631 if: env.PR_DIFF
27− env:
28− ECC_VERSION: "2.3.5"
29− ECC_URL: "https://github.com/editorconfig-checker/editorconfig-checker/releases/download"
32+ - name: install editorconfig-checker from unstable channel
3033 run: |
31− curl -sSf -O -L -C - "$ECC_URL/$ECC_VERSION/ec-linux-amd64.tar.gz" && \
32− tar xzf ec-linux-amd64.tar.gz && \
33− mv ./bin/ec-linux-amd64 ./bin/editorconfig-checker
34+ nix-channel --add https://nixos.org/channels/nixpkgs-unstable
35+ nix-channel --update
36+ nix-env -iA nixpkgs.editorconfig-checker
37+ if: env.PR_DIFF
3438 - name: Checking EditorConfig
3539 if: env.PR_DIFF
3640 run: |
37− echo "$PR_DIFF" | xargs ./bin/editorconfig-checker -disable-indent-size
41+ echo "$PR_DIFF" | xargs editorconfig-checker -disable-indent-size