mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
GH Actions: Beautify kernel hardening analysis
GitHub job summaries do not support colored output, but the kernel hardening script is using colored output. Thus, the job summary in the Actions panel is littered with ugly characters. This commit replaces them with emojis to enhance visibility.
This commit is contained in:
@@ -23,7 +23,7 @@ jobs:
|
||||
|
||||
Analysis:
|
||||
|
||||
name: Analyse
|
||||
name: Check kernel security options
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.repository_owner == 'Armbian' }}
|
||||
steps:
|
||||
@@ -46,9 +46,10 @@ jobs:
|
||||
- name: Check kernel config for security issues
|
||||
# Run kernel-hardening-checker for each kernel config file excluding RISC-V configs, since they are not supported yet.
|
||||
# See https://github.com/a13xp0p0v/kernel-hardening-checker/issues/56
|
||||
# sed explanation: 1) Put spaces in front of every line 2) replace colored output with emojis since GitHub Actions job summaries don't support colored output
|
||||
run: |
|
||||
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
||||
if [[ "${file}" = config/kernel/*.config && ! $(head -n 10 "${file}" | grep -q "riscv") ]]; then
|
||||
kconfig-hardened-check/bin/kernel-hardening-checker -m show_fail -c $file | sed -e 's/^/ /' >> $GITHUB_STEP_SUMMARY
|
||||
kconfig-hardened-check/bin/kernel-hardening-checker -m show_fail -c $file | sed 's/^/ /; s/\x1b\[32m/✅ /; s/\x1b\[31m/❌ /; s/\x1b\[0m//' >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user