-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforgejo-actions.yml
More file actions
76 lines (67 loc) · 2.15 KB
/
Copy pathforgejo-actions.yml
File metadata and controls
76 lines (67 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: fallow-py
on:
pull_request:
push:
branches: [main]
jobs:
fallow-py-cleanup:
runs-on: ubuntu-22.04
steps:
- name: Check out
uses: https://data.forgejo.org/actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python
uses: https://data.forgejo.org/actions/setup-python@v5
with:
python-version: "3.12"
- name: Install fallow-py
run: pip install fallow-py
- name: Run fallow-py
shell: bash
run: |
set +e
if [ "${{ github.event_name }}" = "pull_request" ]; then
fallow-py analyze \
--root . \
--since "${{ github.event.pull_request.base.sha }}" \
--format agent-fix-plan \
--output pyfallow-report.json \
--fail-on warning \
--min-confidence medium
else
fallow-py analyze \
--root . \
--format agent-fix-plan \
--output pyfallow-report.json \
--fail-on warning \
--min-confidence medium
fi
echo "$?" > pyfallow-exit-code.txt
exit 0
- name: Render fallow-py comment
if: always()
shell: bash
run: |
if [ -f pyfallow-report.json ]; then
python examples/ci/render_pyfallow_comment.py pyfallow-report.json > pyfallow-comment.md
else
echo "## fallow-py analysis" > pyfallow-comment.md
echo "" >> pyfallow-comment.md
echo "fallow-py did not produce a JSON report. Check the CI logs." >> pyfallow-comment.md
fi
- name: Upload fallow-py artifacts
if: always()
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
with:
name: fallow-py
path: |
pyfallow-report.json
pyfallow-comment.md
pyfallow-exit-code.txt
if-no-files-found: ignore
- name: Fail on blocking fallow-py findings
if: always()
shell: bash
run: exit "$(cat pyfallow-exit-code.txt 2>/dev/null || echo 0)"