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