Skip to content

Commit

Permalink
Limit git log to 10 lines. set -euxo pipefail
Browse files Browse the repository at this point in the history
  • Loading branch information
willhickey committed Mar 15, 2024
1 parent c9e4a77 commit 98b4b4c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/cherry-pick-from-branch.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env bash

set -euxo pipefail

# Why
# What
# Assumptions:
Expand All @@ -19,17 +22,18 @@ echo "LAST_SHA: $LAST_SHA"

SKIP_COMMIT_STRING="DO NOT SYNC"

# TODO commenting these causes a silent failure. Make it fail loudly
git config --global user.email "noreply@anza.xyz"
git config --global user.name "GHA: Update Upstream From Fork" #TODO better name
git fetch --all
echo "-------------------------"
echo "git log --oneline remotes/$DEST_REMOTE/$DEST_BRANCH:"
git log --oneline "remotes/$DEST_REMOTE/$DEST_BRANCH"
git log --oneline "remotes/$DEST_REMOTE/$DEST_BRANCH" -10
echo "-----------------------"
echo "git log --oneline $BEFORE_SHA~..$LAST_SHA"
git log --oneline "$BEFORE_SHA~..$LAST_SHA"
git log --oneline "$BEFORE_SHA~..$LAST_SHA" -10
echo "-------------------------"
git branch -D temp_branch
# git branch -D temp_branch
git checkout -b temp_branch "remotes/$DEST_REMOTE/$DEST_BRANCH"

for sha1 in $(git log --reverse --format=format:%H $BEFORE_SHA..$LAST_SHA); do
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/update_upstream_from_fork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ jobs:
git fetch --all
git remote --verbose
git branch --all
git log --oneline "origin/$BRANCH_REF" -20
git log --oneline "remotes/upstream/$BRANCH_REF" -20
shell: bash
- name: Cherry pick from origin to upstream
run: |
Expand Down

0 comments on commit 98b4b4c

Please sign in to comment.