π PATCH op tab name #114
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |