netlify / actions

MIT License
375 stars 59 forks source link

Errors don't result in non-zero exit code of the action #67

Open tobiasdiez opened 1 year ago

tobiasdiez commented 1 year ago

If the command fails with an error, for example,

Run netlify/actions/cli@master
  with:
    args: deploy --dir=docs/docs/docs ${NETLIFY_PRODUCTION:+"--prod"} --message ${NETLIFY_MESSAGE} --alias ${NETLIFY_ALIAS}
  env:
    NETLIFY_AUTH_TOKEN: 
    NETLIFY_SITE_ID: 
    NETLIFY_PRODUCTION: true
    NETLIFY_MESSAGE: 3
    NETLIFY_ALIAS: deploy-preview-3
/usr/bin/docker run --name cff9712c1e1f748db99dcb9993c667878_648ce4 --label 49859c --workdir /github/workspace --rm -e "NETLIFY_AUTH_TOKEN" -e "NETLIFY_SITE_ID" -e "NETLIFY_PRODUCTION" -e "NETLIFY_MESSAGE" -e "NETLIFY_ALIAS" -e "INPUT_ARGS" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/sage/sage":"/github/workspace" 49859c:ff9712c1e1f748db99dcb9993c667878 deploy --dir=docs/docs/docs ${NETLIFY_PRODUCTION:+"--prod"} --message ${NETLIFY_MESSAGE} --alias ${NETLIFY_ALIAS}
- Waiting for authorization...
 ›   Error: Timed out waiting for authorization. If you do not have a Netlify account, please create one at https://app.netlify.com/signup, then run netlify login again.
Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Logging into your Netlify account...
Opening https://app.netlify.com/authorize?response_type=ticket&ticket=91a7f69d6fb2478223287a71e6a7e81a
---------------------------
Error: Unable to open browser automatically: Running inside a docker container
Please open your browser and open the URL below:
https://app.netlify.com/authorize?response_type=ticket&ticket=91a7f69d6fb2478223287a71e6a7e81a
---------------------------
Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
https://app.netlify.com/authorize?response_type=ticket
Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

then the step is still marked as successful. I would have expected that the step then also fails.

sneko commented 1 year ago

@kitop could you have a look at it please? It looses all the sense of this "action" if we cannot know about a failure.

Thank you,