.github/workflows/editorconfig.yml: write changed files to disk

This avoids errors when exporting long lists to $GITHUB_ENV.

Co-authored-by: Moritz Hedtke <Moritz.Hedtke@t-online.de>

zowoq 0d02ab20 6e92c47d

+5 -9
+5 -9
.github/workflows/editorconfig.yml
··· 17 17 env: 18 18 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 19 19 run: | 20 - echo 'PR_DIFF<<EOF' >> $GITHUB_ENV 21 20 gh api \ 22 21 repos/NixOS/nixpkgs/pulls/${{github.event.number}}/files --paginate \ 23 22 | jq '.[] | select(.status != "removed") | .filename' \ 24 - >> $GITHUB_ENV 25 - echo 'EOF' >> $GITHUB_ENV 23 + > "$HOME/changed_files" 24 + - name: print list of changed files 25 + run: | 26 + cat "$HOME/changed_files" 26 27 - uses: actions/checkout@v2 27 28 with: 28 29 # pull_request_target checks out the base branch by default 29 30 ref: refs/pull/${{ github.event.pull_request.number }}/merge 30 - if: env.PR_DIFF 31 31 - uses: cachix/install-nix-action@v16 32 - if: env.PR_DIFF 33 32 with: 34 33 # nixpkgs commit is pinned so that it doesn't break 35 34 nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/f93ecc4f6bc60414d8b73dbdf615ceb6a2c604df.tar.gz 36 35 - name: install editorconfig-checker 37 36 run: nix-env -iA editorconfig-checker -f '<nixpkgs>' 38 - if: env.PR_DIFF 39 37 - name: Checking EditorConfig 40 - if: env.PR_DIFF 41 38 run: | 42 - echo "$PR_DIFF" | xargs editorconfig-checker -disable-indent-size 39 + cat "$HOME/changed_files" | xargs -r editorconfig-checker -disable-indent-size 43 40 - if: ${{ failure() }} 44 41 run: | 45 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." 46 -