Skip to content

Commit

Permalink
Merge pull request #1371 from Mic92/merge-when-green-joerg
Browse files Browse the repository at this point in the history
merge-when-green: refactor script
  • Loading branch information
Mic92 authored Oct 22, 2024
2 parents efccc1e + f876e1d commit 2a90214
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkgs/merge-when-green/script.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -eu -o pipefail
set -xeu -o pipefail

cleanupHooks=()
runCleanupHooks() {
Expand Down Expand Up @@ -42,7 +42,7 @@ runTreefmt() {
# detect treefmt embedded in a flake
# shellcheck disable=SC2016
hasTreefmt='(val: val ? ${builtins.currentSystem} && val.${builtins.currentSystem}.name == "treefmt")'
if [[ $(nix eval .#formatter --impure --apply "$hasTreefmt") != true ]]; then
if [[ $(nix eval .#formatter --impure --apply "$hasTreefmt" 2>/dev/null || true) != true ]]; then
return 0
fi
Expand Down Expand Up @@ -74,7 +74,7 @@ main() {
branch=merge-when-green-$(id -un)
isOpen=$(gh pr view --json state --template '{{.state}}' "$branch" || true)
if [[ $isOpen == "OPEN" ]]; then
gh pr checks "$targetBranch"
gh pr checks "$targetBranch" || true
fi
git push --force origin "HEAD:$branch"
Expand Down

0 comments on commit 2a90214

Please sign in to comment.