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

Wait for GitHub to process git push before updating PR #190

Merged

Conversation

annervisser
Copy link
Owner

Wait for GitHub to process git push before updating PR

Updating the pull request (with gh pr edit) right after a git push
was causing the synchronize webhook to be fired twice. This results
in GitHub Actions being started twice as well.

This commit adds a check before editing a pull request that compares
the current HEAD commit with the head id on GitHub. If these don't
match, it means that GitHub has not yet processed the git push.
We check this up to five times, waiting one second between checks.

Fixes #189

@annervisser annervisser self-assigned this Apr 18, 2024
Updating the pull request (with `gh pr edit`) right after a git push
was causing the `synchronize` webhook to be fired twice. This results
in GitHub Actions being started twice as well.

This commit adds a check before editing a pull request that compares
the current HEAD commit with the head id on GitHub. If these don't
match, it means that GitHub has not yet processed the git push.
We check this up to five times, waiting one second between checks.

Fixes #189
@annervisser annervisser force-pushed the wait-for-github-to-process-git-push-before-updating-pr branch from e35608f to b7860a8 Compare April 18, 2024 14:14
@annervisser annervisser enabled auto-merge (rebase) April 18, 2024 14:15
@annervisser annervisser merged commit 5dd1753 into trunk Apr 18, 2024
4 checks passed
@annervisser annervisser deleted the wait-for-github-to-process-git-push-before-updating-pr branch April 18, 2024 14:16
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.

Using pr-cli pick to update a pull request causes actions to trigger twice
1 participant