diff --git a/.github/workflows/analysis.yaml b/.github/workflows/analysis.yaml index f3d07bec..f3b491a5 100644 --- a/.github/workflows/analysis.yaml +++ b/.github/workflows/analysis.yaml @@ -16,4 +16,5 @@ jobs: - name: Analyze run: | - output=$(luau-analyze src || true) # Suppress errors for now. + (luau-analyze src || true) > analyze-log.txt # Suppress errors for now. + bash ./scripts/gh-warn-luau-analyze.sh analyze-log.txt diff --git a/scripts/gh-warn-luau-analyze.sh b/scripts/gh-warn-luau-analyze.sh new file mode 100644 index 00000000..9eecd07f --- /dev/null +++ b/scripts/gh-warn-luau-analyze.sh @@ -0,0 +1,13 @@ +# Read the input file line by line +while IFS= read -r line; do + # Use regex to capture file name, line number, column number, and message + if [[ $line =~ ^(.+)\(([0-9]+),([0-9]+)\):\ (.+)$ ]]; then + file="${BASH_REMATCH[1]}" + line_number="${BASH_REMATCH[2]}" + column_number="${BASH_REMATCH[3]}" + message="${BASH_REMATCH[4]}" + + # Format output for GitHub Actions + echo "::warning file=$file,line=$line_number,col=$column_number::${message}" + fi +done < "$1" \ No newline at end of file