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

Avoid races in CD container builds over symbolic references in checkouts #819

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mzabaluev
Copy link
Collaborator

Summary

  • Categories: cicd.

Don't supply the symbolic GitHub reference name to the ref parameter of the checkout action in the build-push-container-all workflow jobs.
The default behavior of actions/checkout would do the right thing, checking out the SHA of the triggering event, thereby avoiding races with concurrent pushes to the repository modifying the symbolic references.

Don't supply the symbolic GitHub reference name to the `ref` parameter
of the checkout action in the build-push-container-all workflow jobs.
The default behavior of actions/checkout would do the right thing
checking out the SHA of the triggering event, thereby
avoiding races with concurrent pushes to the repository modifying
the symbolic references.
@l-monninger
Copy link
Collaborator

@mzabaluev I believe this will cause it to check out detached heads when responding to a label event.

@mzabaluev
Copy link
Collaborator Author

@mzabaluev I believe this will cause it to check out detached heads when responding to a label event.

That may be actually the correct way to run: the symbolic branch head may have been pushed to another commit by the time the job runs, which has happened e.g. in https://github.com/movementlabsxyz/movement/actions/runs/11726835429/job/32668512421#step:2:215

I can restore the statements as well, but replace the .ref with .sha.

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

Successfully merging this pull request may close these issues.

2 participants