38 lines
815 B
YAML
38 lines
815 B
YAML
name: lint
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [master]
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
|
|
concurrency:
|
|
group: lint-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: nix
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: pick reporter
|
|
run: |
|
|
if [ "${{ github.event_name }}" = pull_request ]; then
|
|
echo "REPORTER=gitea-pr-review" >> "$GITHUB_ENV"
|
|
else
|
|
echo "REPORTER=local" >> "$GITHUB_ENV"
|
|
fi
|
|
|
|
- name: run linters
|
|
run: nix run -L .#ci -- lint . "$RUNNER_TEMP/findings"
|
|
|
|
- name: report findings
|
|
if: always()
|
|
env:
|
|
REVIEWDOG_GITEA_API_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
run: nix run -L .#ci -- lint-report "$REPORTER" "$RUNNER_TEMP/findings"
|