Skip to content

Commit

Permalink
chore: fail on error by default
Browse files Browse the repository at this point in the history
Until know the '--fail-on-error' option for `create-commit` and
`create-report` commands was dependent on a `INPUTS_FAIL_ON_ERROR`.

However `INPUTS_FAIL_ON_ERROR` is not a valid input (see `action.yml`).
Plus, it's not smart to NOT activate this feature, because ATS needs
all these commands to succeed to actually work.

So the present changes activate '--fail-on-error' by default for
`create-commit` and `create-report` commands.
  • Loading branch information
giovanni-guidini committed Dec 28, 2023
1 parent bb85483 commit 412c605
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions dist/codecov_ats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,15 @@ codecovcli_args=""
# Install Codecov CLI
pip install codecov-cli

create_commit_args=""
[[ -n $INPUTS_FAIL_ON_ERROR ]] && create_commit_args+="-Z "
create_commit_args="--fail-on-error "

Check warning on line 49 in dist/codecov_ats.sh

View check run for this annotation

Codecov / codecov/patch

dist/codecov_ats.sh#L49

Added line #L49 was not covered by tests
[[ -n $INPUTS_OVERRIDE_PARENT ]] && create_commit_args+="--parent-sha ${INPUTS_OVERRIDE_PARENT} "
[[ -n $INPUTS_OVERRIDE_PR ]] && create_commit_args+="-P ${INPUTS_OVERRIDE_PR} "
[[ -n $INPUTS_OVERRIDE_BRANCH ]] && create_commit_args+="-B ${INPUTS_OVERRIDE_BRANCH} "
[[ -n $INPUTS_OVERRIDE_COMMIT ]] && create_commit_args+="-C ${INPUTS_OVERRIDE_COMMIT} "
[[ -n $INPUTS_OVERRIDE_SLUG ]] && create_commit_args+="-r ${INPUTS_OVERRIDE_SLUG} "

# create-report
create_report_args=""
[[ -n $INPUTS_FAIL_ON_ERROR ]] && create_report_args+="-Z "
create_report_args="--fail-on-error "

Check warning on line 57 in dist/codecov_ats.sh

View check run for this annotation

Codecov / codecov/patch

dist/codecov_ats.sh#L57

Added line #L57 was not covered by tests
[[ -n $INPUTS_OVERRIDE_COMMIT ]] && create_report_args+="-C ${INPUTS_OVERRIDE_COMMIT} "
[[ -n $INPUTS_OVERRIDE_SLUG ]] && create_report_args+="-r ${INPUTS_OVERRIDE_SLUG} "

Expand Down
6 changes: 2 additions & 4 deletions src/codecov_ats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,15 @@ codecovcli_args=""
# Install Codecov CLI
pip install codecov-cli

create_commit_args=""
[[ -n $INPUTS_FAIL_ON_ERROR ]] && create_commit_args+="-Z "
create_commit_args="--fail-on-error "
[[ -n $INPUTS_OVERRIDE_PARENT ]] && create_commit_args+="--parent-sha ${INPUTS_OVERRIDE_PARENT} "
[[ -n $INPUTS_OVERRIDE_PR ]] && create_commit_args+="-P ${INPUTS_OVERRIDE_PR} "
[[ -n $INPUTS_OVERRIDE_BRANCH ]] && create_commit_args+="-B ${INPUTS_OVERRIDE_BRANCH} "
[[ -n $INPUTS_OVERRIDE_COMMIT ]] && create_commit_args+="-C ${INPUTS_OVERRIDE_COMMIT} "
[[ -n $INPUTS_OVERRIDE_SLUG ]] && create_commit_args+="-r ${INPUTS_OVERRIDE_SLUG} "

# create-report
create_report_args=""
[[ -n $INPUTS_FAIL_ON_ERROR ]] && create_report_args+="-Z "
create_report_args="--fail-on-error "
[[ -n $INPUTS_OVERRIDE_COMMIT ]] && create_report_args+="-C ${INPUTS_OVERRIDE_COMMIT} "
[[ -n $INPUTS_OVERRIDE_SLUG ]] && create_report_args+="-r ${INPUTS_OVERRIDE_SLUG} "

Expand Down

0 comments on commit 412c605

Please sign in to comment.