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 succeeds even when push fails #1472

Closed
rossjrw opened this issue Nov 2, 2023 · 1 comment
Closed

Action succeeds even when push fails #1472

rossjrw opened this issue Nov 2, 2023 · 1 comment
Labels
bug 🐦 Something isn't working help wanted 📲 Extra attention is needed

Comments

@rossjrw
Copy link
Contributor

rossjrw commented Nov 2, 2023

Errors as a result of git push are currently ignored:

const pushResult = await execute(
`git push --porcelain ${action.repositoryPath} ${temporaryDeploymentBranch}:${action.branch}`,
`${action.workspace}/${temporaryDeploymentDirectory}`,
action.silent,
true // Ignore non-zero exit status
)

There's a check that looks for strings like '[rejected]' in the output, but these aren't guaranteed to appear. E.g. when authentication fails, the error string starts with 'fatal:' instead. It would be more robust to fail the script if an error is detected and the string match also failed - in this case, repeating the attempted push several times probably won't ever work anyway.

See the following workflow log where this error happened and was ignored, resulting in the job succeeding while the deployment did not actually succeed: https://github.com/www-learn-study/saraswati.learn.study/actions/runs/6727951896/job/18286524048, section 'Deploy preview'

This issue appears to have been introduced with #1054.

@JamesIves
Copy link
Owner

This has been resolved in the next version where a check for fatal: occurs on every line as opposed to just the first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐦 Something isn't working help wanted 📲 Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants