mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 15:13:46 +00:00
38 lines
1.1 KiB
YAML
38 lines
1.1 KiB
YAML
name: "Checking EditorConfig"
|
|
|
|
on:
|
|
pull_request:
|
|
branches-ignore:
|
|
- 'release-**'
|
|
|
|
jobs:
|
|
tests:
|
|
runs-on: ubuntu-latest
|
|
if: github.repository_owner == 'NixOS'
|
|
steps:
|
|
- name: Get list of changed files from PR
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
echo 'PR_DIFF<<EOF' >> $GITHUB_ENV
|
|
gh api \
|
|
repos/NixOS/nixpkgs/pulls/${{github.event.number}}/files --paginate \
|
|
| jq '.[] | select(.status != "removed") | .filename' \
|
|
>> $GITHUB_ENV
|
|
echo 'EOF' >> $GITHUB_ENV
|
|
- uses: actions/checkout@v2
|
|
if: env.PR_DIFF
|
|
- name: Fetch editorconfig-checker
|
|
if: env.PR_DIFF
|
|
env:
|
|
ECC_VERSION: "2.3.1"
|
|
ECC_URL: "https://github.com/editorconfig-checker/editorconfig-checker/releases/download"
|
|
run: |
|
|
curl -sSf -O -L -C - "$ECC_URL/$ECC_VERSION/ec-linux-amd64.tar.gz" && \
|
|
tar xzf ec-linux-amd64.tar.gz && \
|
|
mv ./bin/ec-linux-amd64 ./bin/editorconfig-checker
|
|
- name: Checking EditorConfig
|
|
if: env.PR_DIFF
|
|
run: |
|
|
echo "$PR_DIFF" | xargs ./bin/editorconfig-checker -disable-indent-size
|