Skip to content

Commit

Permalink
Update workflow to checkout branch (#2505)
Browse files Browse the repository at this point in the history
* Update workflow to checkout branch

* Update workflow to checkout branch

* Update workflow to checkout branch
  • Loading branch information
alerman authored Aug 9, 2024
1 parent f9c1b69 commit 30a9a07
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ jobs:
java-version: ${{env.JAVA_VERSION}}
maven-version: 3.9.5
cache: 'maven'
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Format code
env:
USER_NAME: ${{ secrets.USER_NAME }}
Expand All @@ -42,6 +46,7 @@ jobs:
- name: Commit Changes
run: |
if [ "$diffs_found" = true ]; then
git checkout -b ${{ steps.extract_branch.outputs.branch }}
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git commit -am "Formatting job fix"
Expand Down

0 comments on commit 30a9a07

Please sign in to comment.