From 1d03944a9cd4211f4b9ffd90d4e3c13539fc34ae Mon Sep 17 00:00:00 2001 From: sideshowbarker Date: Tue, 23 Jul 2024 16:58:31 +0900 Subject: [PATCH] =?UTF-8?q?CI:=20Make=20notes-push=20workflow=20return=20z?= =?UTF-8?q?ero=20even=20when=20=E2=80=9Cgit=20push=E2=80=9D=20fails?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s possible but unlikely that a push of generated notes back to the remote can fail with a message like > [remote rejected] ... cannot > lock ref 'refs/notes/commits': is at > f3648f50bb but expected 47686bf473 See https://github.com/LadybirdBrowser/ladybird/actions/runs/10054314539 So this change makes the call to “git push” for notes not return 0 even if it fails — because it’s not actually a fatal error when it happens, and not something we need to stop and fix. Instead, it fixes itself. Specifically: If one CI job for a PR merge/push to master generates some notes but fails to push them to the origin, the notes don’t get dropped on the floor and lost. Instead, the notes-generator tool looks at the entire history; and if it finds commits that don’t have notes — even if those commits are not part of the PR push/merge it’s operating on — it generates notes for those. In other words, if notes for one PR push/job fail for some reason to get pushed back to the remote, they get regenerated by the next PR push/job. --- .github/workflows/notes-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/notes-push.yml b/.github/workflows/notes-push.yml index 06c15f24f6f..a5bb21bd13a 100644 --- a/.github/workflows/notes-push.yml +++ b/.github/workflows/notes-push.yml @@ -17,6 +17,6 @@ jobs: - run: | git fetch origin "refs/notes/*:refs/notes/*" curl -fsSLO https://sideshowbarker.github.io/git-gloss/git-gloss && bash ./git-gloss - git push origin "refs/notes/*" + git push origin "refs/notes/*" || true env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}