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

build-and-push-assets: more defensive git checkout/pull #145

Merged
merged 2 commits into from
Aug 6, 2024

Conversation

tfrommen
Copy link
Member

@tfrommen tfrommen commented Jul 30, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Be more defensive when attempting to checkout or pull a potentially non-existing remote branch.

  • Instead of doing git checkout <BRANCH> || git checkout -b <BRANCH>, which pollutes the workflow log, check if the branch exists (and then check it out), or create it in the CI.
  • Only pull a branch that exists (on the remote).

What is the current behavior? (You can also link to an open issue here)

  • The Git pull on re-run step fails in case the target branch does not exist yet.
  • The logic in the Checkout and merge the built branch and Checkout and merge the release branch steps is not straightforward and will print warnings to the terminal if the target branch does nto exist yet.

What is the new behavior (if this is a feature change)?

  • Everything works without warnings or errors/failures.

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

No.

Other information:

Closes #140.

@tfrommen tfrommen requested a review from dottxado July 30, 2024 14:24
@tfrommen tfrommen changed the title Defensive git build-and-push-assets: more defensive git checkout/pull Jul 30, 2024
Copy link
Member

@tyrann0us tyrann0us left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tyrann0us tyrann0us merged commit e23811f into main Aug 6, 2024
@tyrann0us tyrann0us deleted the defensive-git branch August 6, 2024 08:49
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

Successfully merging this pull request may close these issues.

[Bug]: build-and-push doesn't manage the error pulling just-created branch
3 participants