This repository has been archived by the owner on Aug 15, 2023. It is now read-only.
release ver3.8 and close #1008 #1478
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: Code check | |
on: push | |
jobs: | |
code_check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install node modules | |
run: npm install | |
- name: Check code | |
id: check-code | |
run: | | |
check_output=$(npm run --silent code-check || :) | |
check_failed=$([[ -z "$check_output" ]] && echo 'false' || echo 'true') | |
check_output=$(echo -e "\`\`\`${check_output}\n\`\`\`") | |
check_output="${check_output//'%'/'%25'}" | |
check_output="${check_output//$'\n'/'%0A'}" | |
check_output="${check_output//$'\r'/'%0D'}" | |
echo check_output="$check_output" >> $GITHUB_OUTPUT | |
echo check_failed="$check_failed" >> $GITHUB_OUTPUT | |
- name: Comment if check failed | |
uses: peter-evans/commit-comment@v1 | |
if: ${{ 'true' == steps.check-code.outputs.check_failed }} | |
with: | |
body: ${{ steps.check-code.outputs.check_output }} | |
- name: Error if check failed | |
if: ${{ 'true' == steps.check-code.outputs.check_failed }} | |
run: exit -1 |