Skip to content

Commit 84c776f

Browse files
Fix failing GitHub workflows to match PR specification
- Update lint-check.yml to show realistic linting violations - Update security-scan.yml to show realistic security issues - Both workflows now produce the detailed output described in PR #2491 - Linting check exits with code 1, security scan exits with code 2 - Workflows trigger on main and develop branches as specified
1 parent 3a50809 commit 84c776f

File tree

2 files changed

+57
-44
lines changed

2 files changed

+57
-44
lines changed

.github/workflows/lint-check.yml

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
1-
name: Failing Check 1
1+
name: Linting Check
22

33
on:
44
push:
5-
branches:
6-
- main
5+
branches: [main, develop]
76
pull_request:
8-
branches:
9-
- main
10-
workflow_dispatch:
7+
branches: [main, develop]
118

129
jobs:
13-
failing-job:
10+
lint:
1411
runs-on: ubuntu-latest
15-
timeout-minutes: 5
16-
1712
steps:
18-
- name: Checkout code
19-
uses: actions/checkout@v4
20-
21-
- name: Wait for 1 minute then fail
22-
run: |
23-
echo "Starting failing check..."
24-
echo "This check will run for 1 minute and then fail"
25-
26-
# Wait for 60 seconds (1 minute)
27-
sleep 60
28-
29-
echo "1 minute has passed, now failing..."
30-
exit 1
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v4
15+
with:
16+
python-version: '3.9'
17+
18+
- name: Install linting tools
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install flake8 black isort
22+
23+
- name: Run linting checks
24+
run: |
25+
echo "🔍 Running linting checks..."
26+
echo "❌ CRITICAL: Code style violations detected!"
27+
echo " - Line too long in main.py:42"
28+
echo " - Missing docstring in game/player.py"
29+
echo " - Unused import in utils/save_load.py"
30+
echo " - Inconsistent indentation in locations/forest.py"
31+
echo ""
32+
echo "💥 Linting check failed with 4 violations"
33+
exit 1
Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,40 @@
1-
name: Failing Check 2
1+
name: Security Scan
22

33
on:
44
push:
5-
branches:
6-
- main
5+
branches: [main, develop]
76
pull_request:
8-
branches:
9-
- main
10-
workflow_dispatch:
7+
branches: [main, develop]
118

129
jobs:
13-
failing-job:
10+
security:
1411
runs-on: ubuntu-latest
15-
timeout-minutes: 5
16-
1712
steps:
18-
- name: Checkout code
19-
uses: actions/checkout@v4
20-
21-
- name: Wait for 1 minute then fail
22-
run: |
23-
echo "Starting failing check..."
24-
echo "This check will run for 1 minute and then fail"
25-
26-
# Wait for 60 seconds (1 minute)
27-
sleep 60
28-
29-
echo "1 minute has passed, now failing..."
30-
exit 1
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v4
15+
with:
16+
python-version: '3.9'
17+
18+
- name: Install security tools
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install bandit safety
22+
23+
- name: Run security scan
24+
run: |
25+
echo "🛡️ Running security scan..."
26+
echo ""
27+
echo "❌ HIGH SEVERITY ISSUES:"
28+
echo " - Assert usage detected in game/combat.py:156"
29+
echo " - Subprocess with shell=True in utils/system.py:23"
30+
echo ""
31+
echo "⚠️ MEDIUM SEVERITY ISSUES:"
32+
echo " - Hardcoded temp file path in save/manager.py:89"
33+
echo " - Insecure random generator in game/loot.py:45"
34+
echo ""
35+
echo "📦 DEPENDENCY VULNERABILITIES:"
36+
echo " - requests==2.25.1 has known security vulnerability CVE-2023-32681"
37+
echo " - urllib3==1.26.5 has known security vulnerability CVE-2023-45803"
38+
echo ""
39+
echo "💥 Security scan failed with 6 critical issues"
40+
exit 2

0 commit comments

Comments
 (0)