Skip to content

Commit

Permalink
extract branch name
Browse files Browse the repository at this point in the history
  • Loading branch information
denrase committed Aug 14, 2023
1 parent 9558cfb commit cb0a512
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/format-and-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ jobs:
- run: dart format .
- run: dart fix --apply

- 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.
- run: ./scripts/commit-formatted-code.sh $GITHUB_HEAD_REF
- run: ./scripts/commit-formatted-code.sh ${{ steps.extract_branch.outputs.branch }}

0 comments on commit cb0a512

Please sign in to comment.