Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action Failure - Inputs for exiting non-zero #17

Open
arizonaherbaltea opened this issue Jul 26, 2021 · 0 comments
Open

Action Failure - Inputs for exiting non-zero #17

arizonaherbaltea opened this issue Jul 26, 2021 · 0 comments

Comments

@arizonaherbaltea
Copy link

Is your feature request related to a problem? Please describe.
This action seems to always exit non-zero, which leads to false positives. The Github action frame-work already has the continue-on-error: true attribute which can be set for each step in a job. Additionally, if the action didn't do what it should do, which in this case is sync files, it should always return non-zero when it doesn't.

This sample output didn't actually make any changes.

...which for my implementation is good. In this case I want the workflow to repo 'success', but for other conditions I may want this to report as a 'failure':
image

Here's an example where the copy failed, but this action reports a success (???):

If I ask the action to copy files and they don't exist, this is a failure in my opinion. On the other side, If there are files but this action fails to perform the copy it should still report as a failure.
image

Here's an example where this action failed to create a branch (due to a URL unfriendly name), but instead exited to a success status:

image

Describe the solution you'd like
The approach which I'd recommend would be to have the additional inputs be verified for 'real' success and if this action is unable to perform them completely and successfully, then fast-fail. Example:

with:
  ..
  ...
  PULL_REQUEST: true # if for ANY reason this is unsuccessful, the action exits non-zero because I've asked this action to create a pull-request.
  AUTO_CREATE_NEW_BRANCH: true # if for ANY reason no branch was created or exists with the provided name, then exit non-zero
  WORKFLOW_FILES: |
    file1 # if this file exists in the source repo and doesn't after the commit step, fail the action
    folder2=folder1 # if content fails to copy, fail the action
  GITHUB_TOKEN: 90234560346523458234example # if unable to clone the source repo or push to the destination repo, again..fail this action.

If there is an issue with the release version, since this would probably be a breaking-change, then create a new input, but default it to true. When ready to release the need major version such as v4.0, then just make this default false.

with:
  ..
  ...
  INGNORE_FAILURES: true # this is defaulted to true, but can be set to `false` to get the behavior described above.

Describe alternatives you've considered
There are many ways to implement this, even not exiting non-zero, such as outputting the 'end-state' or 'exit status'. Here's an example:
*exit-status: "unknown_error"
*exit-status: "clone_failure"
*exit-status: "copy_failed"
*exit-status: "invalid_token"
*exit-status: "pull-request_failed"
*exit-status: "ect,ect."

With these statuses, a Final status for the github workflow/job can be determined in a subsequent step as to whether the action really did what the implementation needs.
Additional context
Add any other context or screenshots about the feature request here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant