Skip to content

Commit

Permalink
fix format pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto committed Sep 26, 2023
1 parent 479252f commit 0a82305
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/format-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,17 @@ jobs:
- name: Format
run: make format

# actions/checkout fetches only a single commit in a detached HEAD state. Therefore
# we need to pass the current branch, otherwise we can't commit the changes.
# GITHUB_HEAD_REF is the name of the head branch. GitHub Actions only sets this for PRs.
- name: Commit Formatted Code
run: ./scripts/commit-code.sh $GITHUB_HEAD_REF
# Source: https://stackoverflow.com/a/58035262
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

# actions/checkout fetches only a single commit in a detached HEAD state. Therefore
# we need to pass the current branch, otherwise we can't commit the changes.
# GITHUB_HEAD_REF is the name of the head branch. GitHub Actions only sets this for PRs.
- name: Commit Formatted Code and API
run: ./scripts/commit-code.sh ${{ steps.extract_branch.outputs.branch }}

- name: Make stop
run: make stop

0 comments on commit 0a82305

Please sign in to comment.