From f04a1aa6bca545567e4f35b705eb2cdc54028755 Mon Sep 17 00:00:00 2001 From: catvayor Date: Thu, 10 Apr 2025 17:32:08 +0200 Subject: [PATCH] feat(workflows/npins-update): push when only rebasing Co-authored-by: Tom Hubrecht --- .forgejo/workflows/npins-update.yaml | 60 ++++++++++++++-------------- workflows/npins-update.nix | 2 + 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/.forgejo/workflows/npins-update.yaml b/.forgejo/workflows/npins-update.yaml index 1fdab3a1..3ff96f65 100644 --- a/.forgejo/workflows/npins-update.yaml +++ b/.forgejo/workflows/npins-update.yaml @@ -34,7 +34,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" arkheon: runs-on: nix steps: @@ -63,7 +63,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" cas-eleves: runs-on: nix steps: @@ -92,7 +92,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" cgroup-exporter: runs-on: nix steps: @@ -121,7 +121,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" colmena: runs-on: nix steps: @@ -150,7 +150,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" dgsi: runs-on: nix steps: @@ -179,7 +179,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" disko: runs-on: nix steps: @@ -208,7 +208,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" dns_nix: runs-on: nix steps: @@ -237,7 +237,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" git-hooks: runs-on: nix steps: @@ -266,7 +266,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" kadenios: runs-on: nix steps: @@ -295,7 +295,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" kahulm: runs-on: nix steps: @@ -324,7 +324,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" kat-pkgs: runs-on: nix steps: @@ -353,7 +353,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" liminix: runs-on: nix steps: @@ -382,7 +382,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" linkal: runs-on: nix steps: @@ -411,7 +411,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" lix: runs-on: nix steps: @@ -440,7 +440,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" lix-module: runs-on: nix steps: @@ -469,7 +469,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" lon: runs-on: nix steps: @@ -498,7 +498,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" metis: runs-on: nix steps: @@ -527,7 +527,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" microvm_nix: runs-on: nix steps: @@ -556,7 +556,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" nix-actions: runs-on: nix steps: @@ -585,7 +585,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" nix-modules: runs-on: nix steps: @@ -614,7 +614,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" nix-pkgs: runs-on: nix steps: @@ -643,7 +643,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" nix-reuse: runs-on: nix steps: @@ -672,7 +672,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" nixos-24_05: runs-on: nix steps: @@ -701,7 +701,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" nixos-24_11: runs-on: nix steps: @@ -730,7 +730,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" nixos-generators: runs-on: nix steps: @@ -759,7 +759,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" nixos-unstable: runs-on: nix steps: @@ -788,7 +788,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" signal-irc-bridge: runs-on: nix steps: @@ -817,7 +817,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" stateless-uptime-kuma: runs-on: nix steps: @@ -846,7 +846,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" wp4nix: runs-on: nix steps: @@ -875,7 +875,7 @@ jobs: no PR with the same title exists\n if [ -z $(tea pr ls -f='head' -o simple | grep \"$GIT_UPDATE_BRANCH\") ]; then\n tea pr create --description \"\ Automatic npins update\" --title \"$COMMIT_MESSAGE\" --head \"$GIT_UPDATE_BRANCH\"\ - \n fi\nfi\n" + \n fi\nelif [ -n \"$EXISTING_BRANCH\" ]; then\n git push --force\nfi\n" name: Update dependencies on: schedule: diff --git a/workflows/npins-update.nix b/workflows/npins-update.nix index 56c4e6a5..4d047329 100644 --- a/workflows/npins-update.nix +++ b/workflows/npins-update.nix @@ -84,6 +84,8 @@ in if [ -z $(tea pr ls -f='head' -o simple | grep "$GIT_UPDATE_BRANCH") ]; then tea pr create --description "Automatic npins update" --title "$COMMIT_MESSAGE" --head "$GIT_UPDATE_BRANCH" fi + elif [ -n "$EXISTING_BRANCH" ]; then + git push --force fi ''; }