Skip to content

Commit

Permalink
Evaluate ESLint result in a next step
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadxali committed Nov 19, 2024
1 parent bba9d59 commit de8f1c5
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,24 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Run ESLint (Expecting failure)
continue-on-error: true
- name: Run ESLint
id: eslint
run: |
cd tests/react-ts
pnpm lint
lint_exit_code=$?
echo "The exit code of pnpm lint is: $lint_exit_code"
echo "lint_exit_code=$lint_exit_code" >> $GITHUB_ENV
continue-on-error: true # Allow failure but capture exit code

if [ $lint_exit_code -eq 0 ]; then
echo "ESLint passed, which is unexpected. Marking this as a failure."
- name: Evaluate ESLint result
run: |
if [ "$lint_exit_code" -eq 0 ]; then
echo "ESLint passed unexpectedly. Marking this as a failure."
exit 1
else
echo "ESLint failed, which is expected. Marking this as a success."
echo "ESLint failed as expected. Marking this as a success."
exit 0
fi
env:
lint_exit_code: ${{ env.lint_exit_code }}

0 comments on commit de8f1c5

Please sign in to comment.