Skip to content

Commit 11d7cf7

Browse files
committed
fix(ci): retry generator jobs
Problem: docgen fails if gen-annotations pushes before it: [master c2804a4] docs: update configs.md skip-checks: true 2 files changed, 24 insertions(+), 20 deletions(-) To https://github.com/neovim/nvim-lspconfig ! [rejected] master -> master (fetch first) error: failed to push some refs to 'https://github.com/neovim/nvim-lspconfig' hint: Updates were rejected because the remote contains work that you do not hint: have locally. This is usually caused by another repository pushing to Solution: If push fails, rebase and retry. The two workflows touch disjoint files so the rebase should alway resolve.
1 parent 027861f commit 11d7cf7

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

.github/workflows/docgen.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,11 @@ jobs:
3030
git config user.email "github-actions[bot]@users.noreply.github.com"
3131
git add doc/configs.md doc/configs.txt
3232
# Only commit and push if we have changes
33-
git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push)
33+
git diff --quiet && git diff --staged --quiet || (
34+
git commit -m "${COMMIT_MSG}"
35+
for i in 1 2 3; do
36+
git pull --rebase && git push && break
37+
echo "Push failed (attempt $i), retrying..."
38+
sleep 5
39+
done
40+
)

.github/workflows/gen-annotations.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,11 @@ jobs:
3737
git config user.email "github-actions[bot]@users.noreply.github.com"
3838
git add README.md
3939
git add -A lua/lspconfig/types
40-
git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push)
40+
git diff --quiet && git diff --staged --quiet || (
41+
git commit -m "${COMMIT_MSG}"
42+
for i in 1 2 3; do
43+
git pull --rebase && git push && break
44+
echo "Push failed (attempt $i), retrying..."
45+
sleep 5
46+
done
47+
)

0 commit comments

Comments
 (0)