Skip to content

πŸ› PATCH op tab name #114

πŸ› PATCH op tab name

πŸ› PATCH op tab name #114

Workflow file for this run

name: "CI: Coding-Style"
on:
pull_request:
workflow_dispatch:
workflow_call:
jobs:
coding_style:
name: "🍌 Epitech coding-style"
runs-on: ubuntu-latest
permissions: write-all
container:
image: ghcr.io/epitech/coding-style-checker:latest
steps:
- name: "πŸ“₯ Checkout repository"
uses: actions/checkout@v3
- name: "βš™οΈ Run conding-style"
id: coding_style
run: |
echo 'coding_style<<EOF' >> $GITHUB_OUTPUT
check.sh $(pwd) $(pwd) >> $GITHUB_OUTPUT
cat coding-style-reports.log >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: "πŸ’¬ Display pull-request errors"
if: ${{ steps.coding_style.outputs.coding_style != '' && github.event_name == 'pull_request' }}
continue-on-error: true
uses: thollander/actions-comment-pull-request@v2
with:
message: |
## 🍌 Epitech coding-style report
${{ steps.coding_style.outputs.coding_style }}
- name: "πŸ’¬ Log errors"
if: ${{ steps.coding_style.outputs.coding_style != '' }}
run: |
while read -r line
do error_type=$(echo $line | cut -d ':' -f 3 | cut -c 2-)
code=$(echo $line | cut -d ':' -f 4)
filename=$(echo $line | cut -d ':' -f 1)
line_number=$(echo $line | cut -d ':' -f 2)
echo "::error title=$error_type coding style error,file=$filename,line=$line_number::$code"
done < coding-style-reports.log
exit 1