Flipper-IRDB/.github/workflows/pr_lint_review.yaml
Daniel 07dbeb8f66
ci: don't auto approve / request changes
since this doesn't require a GITHUB_TOKEN with write access
2022-12-18 18:45:25 +01:00

63 lines
1.7 KiB
YAML

name: "🧐 [Lint] Checking IR files"
on:
pull_request:
paths: '**.ir'
jobs:
lint:
name: "🐛 Looking for issues"
runs-on: ubuntu-latest
steps:
# checkout IRDB
- uses: actions/checkout@v3
with:
fetch-depth: 0
# checkout Linter
- uses: actions/checkout@v3
with:
repository: 'darmiel/fff-ir-lint'
path: fff-ir-lint
# only check files changed in the PR
- name: Get Changed Files
id: changed-files
uses: tj-actions/changed-files@v29.0.7
with:
files: "**/*.ir"
separator: "\n"
- name: Save changed file names to file
run: echo '${{ steps.changed-files.outputs.all_changed_files }}' > changed_file_list.txt
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Run Linter if at least 1 IR File Changed
uses: mathiasvr/command-output@v1.1.0
id: run
continue-on-error: true
with:
run: python fff-ir-lint/main.py github2 file:changed_file_list.txt
- name: Request Changes
uses: thollander/actions-comment-pull-request@v2
if: ${{ steps.run.outputs.stderr }}
with:
message: |
❌ Found Issues
${{ steps.run.outputs.stdout }}
- name: Request Changes
uses: thollander/actions-comment-pull-request@v2
if: ${{ ! steps.run.outputs.stderr }}
with:
message: |
LGTM! 😊 No issues found.
- name: Fail Pipeline
if: ${{ steps.run.outputs.stderr }}
run: exit 1