CI: try to make push of flake-update to main work

It currently fails with

```
 ! [rejected]        HEAD -> main (fetch first)
error: failed to push some refs to 'https://github.com/marienz/nix-doom-emacs-unstraightened'
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
hint: the same ref. If you want to integrate the remote changes, use
hint: 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for
details.
```

Our local checkout is shallow. Assume we can fix this by fetching just
the parent of the commit we want to push, which should be the commit
origin/main points at.
This commit is contained in:
Marien Zwart 2024-06-22 22:29:35 +10:00
parent 5e2835bffe
commit 0c55f6064f
No known key found for this signature in database

View file

@ -28,6 +28,10 @@ jobs:
uses: actions/checkout@v4
with:
ref: flake-update
# Fetch the parent of the commit we want to push too:
# that should be the current ref of `main`, which we need
# for push to succeed (without forcing).
fetch-depth: 2
- name: Push changes
run: git push origin HEAD:main
# `git push` only works because branch protection is not enabled.