diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2466d74..abede88 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -101,6 +101,20 @@ jobs: cat "${{ env.CUSTOM_OUTPUT_DUMP_PATH }}" fi + - name: test output set in args and action input + id: output_set_in_args_and_action_input + uses: ./ + with: + args: --output foo - + output: bar + continue-on-error: true + + - name: test output set in args and action input should fail - validation + if: steps.output_set_in_args_and_action_input.outcome != 'failure' + run: | + echo "Output set in args and action input should have failed." + exit 1 + - name: test failIfEmpty - no links in input should fail the pipeline id: fail_if_empty_test uses: ./ diff --git a/entrypoint.sh b/entrypoint.sh index 4210a86..deebb9c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -21,6 +21,12 @@ FORMAT="" # If `format` occurs in args, ignore the value from `INPUT_FORMAT` [[ "$ARGS" =~ "--format " ]] || FORMAT="--format ${INPUT_FORMAT}" +# If `output` occurs in args and `INPUT_OUTPUT` is set, exit with an error +if [[ "$ARGS" =~ "--output " ]] && [ -n "${INPUT_OUTPUT:-}" ]; then + echo "Error: 'output' is set in args as well as in the action configuration. Please remove one of them." + exit 1 +fi + # Execute lychee eval lychee ${FORMAT} --output ${LYCHEE_TMP} ${ARGS} exit_code=$?