-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
98 lines (84 loc) · 2.69 KB
/
action.yml
File metadata and controls
98 lines (84 loc) · 2.69 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: "codefixguy"
description: "Automate code quality fixes for Python, JS, TS, Java, and Go"
author: "CyberSage5"
branding:
icon: "tool"
color: "#1976D2"
inputs:
github-token:
description: "GitHub token with repo scope"
required: true
default: ${{ github.token }}
runs:
using: "composite"
steps:
# Check out FixGuy repo to access requirements.txt
- name: Checkout FixGuy repo
uses: actions/checkout@v4
with:
repository: CyberSage5/fixguy
path: fixguy-action
- name: Debug the checkout
run: |
echo "Listing contents of fixguy-action:"
ls -la fixguy-action/
if [ -f "fixguy-action/requirements.txt" ]; then
echo "requirements.txt found!"
cat fixguy-action/requirements.txt
else
echo "Error: requirements.txt not found in fixguy-action/"
exit 1
fi
shell: bash
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Python dependencies
run: |
echo "Upgrading pip..."
python -m pip install --upgrade pip
if [ -f "fixguy-action/requirements.txt" ]; then
echo "Installing dependencies from requirements.txt"
pip install -r fixguy-action/requirements.txt
echo "Installed packages:"
pip list | grep -E "PyGithub|flake8|GitPython"
else
echo "Error: requirements.txt not found in fixguy-action/"
ls -la fixguy-action/
exit 1
fi
shell: bash
- name: Set up Node.js for ESLint
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install ESLint
run: npm install eslint --global
shell: bash
- name: Set up Java for Checkstyle
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
- name: Install Checkstyle
run: |
wget -O checkstyle.jar https://github.com/checkstyle/checkstyle/releases/download/checkstyle-10.17.0/checkstyle-10.17.0-all.jar
sudo mv checkstyle.jar /usr/local/lib/
shell: bash
- name: Set up Go for Staticcheck
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Install Staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest
shell: bash
# Check out the user's repo for linting
- name: Checkout user's repo
uses: actions/checkout@v4
with:
path: user-repo
- name: Run FixGuy
run: python -m main "${{ github.event.repository.html_url }}" "${{ inputs.github-token }}"
working-directory: fixguy-action
shell: bash