3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/.github/workflows/editorconfig.yml

38 lines
1.1 KiB
YAML
Raw Normal View History

2020-08-23 10:22:58 +01:00
name: "Checking EditorConfig"
on:
pull_request:
branches-ignore:
- 'release-**'
2020-08-23 10:22:58 +01:00
jobs:
tests:
runs-on: ubuntu-latest
if: github.repository_owner == 'NixOS'
2020-08-23 10:22:58 +01:00
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
2020-08-23 10:22:58 +01:00
- uses: actions/checkout@v2
if: env.PR_DIFF
2020-08-23 10:22:58 +01:00
- name: Fetch editorconfig-checker
if: env.PR_DIFF
2020-08-23 10:22:58 +01:00
env:
ECC_VERSION: "2.3.1"
2020-08-23 10:22:58 +01:00
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
2020-08-23 10:22:58 +01:00
run: |
echo "$PR_DIFF" | xargs ./bin/editorconfig-checker -disable-indent-size