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