diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index 78c373c809..9d0ab12127 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -53,8 +53,11 @@ jobs: # 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 - if: env.GITHUB_HEAD_REF != null + - name: commit formatted code + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + run: echo $BRANCH_NAME # ../scripts/commit-formatted-code.sh $BRANCH_NAME + if: $BRANCH_NAME != null - name: dart analyze uses: invertase/github-action-dart-analyzer@cdd8652b05bf7ed08ffce30f425436780f869f13 # pin@v1