feat: add fail_on_error parameter support on github actions #25
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: Commitlint | |
on: | |
push: | |
branches: ["main", "fail_on_error"] | |
pull_request: | |
jobs: | |
commitlint: | |
runs-on: ubuntu-latest | |
name: Commitlint | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run commitlint | |
id: commitlintrun | |
uses: ./ # Uses an action in the root directory | |
# or use a released GitHub Action | |
# uses: opensource-nepal/[email protected] | |
with: | |
fail_on_error: false | |
- name: Check Output | |
run: | | |
echo 'Status - ${{ steps.commitlintrun.outputs.status }}' | |
echo 'Exit Code - ${{ steps.commitlintrun.outputs.exit_code }}' | |
# Check if commitlintrun status is equal to "failure" | |
if [ "${{ steps.commitlintrun.outputs.status }}" = "failure" ]; then | |
echo "Failing the job manually because Commitlint status is failure." | |
exit 1 # This line manually fails the job | |
fi |