Skip to content

Commit

Permalink
chore: Set git username/email
Browse files Browse the repository at this point in the history
  • Loading branch information
lqiu96 committed Sep 23, 2022
1 parent 08ddf73 commit abb4b92
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/generate_diffs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ jobs:
with:
repository: 'googleapis/google-cloud-java'
- name: Run generate-diff script
run: |
./generation/generate_diff.sh
run: ./generation/generate_diff.sh
env:
USERNAME: ${{ github.actor }}
5 changes: 3 additions & 2 deletions generation/generate_diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ function retry_with_backoff {
return $exit_code
}

[ -z "`git config user.email`" ] && git config --global user.email "${USERNAME:-script}@google.com"
[ -z "`git config user.name`" ] && git config --global user.name "${USERNAME:-script}"

current_branch="main-diff"
diff_java_branch="main-diff_java"
diff_non_java_branch="main-diff_non_java"
Expand All @@ -50,8 +53,6 @@ else
git checkout -b "${current_branch}"
fi

git checkout "${current_branch}"

if [[ $(git branch | grep "${diff_java_branch}") ]]; then
git branch -D "${diff_java_branch}"
fi
Expand Down

0 comments on commit abb4b92

Please sign in to comment.