Skip to content

[actions] fix flutter_analysis formatting step #365

@GroovinChip

Description

@GroovinChip

I tried to set up the "Format code" step to auto-commit and push any changes from running dart format, but the job fails if there are any changes because I left in --set-exit-if-changed.

It should look like this:

      - name: Format code
        run: |
          dart format .
          if [ $? -eq 1 ]; then
            git add .
            git commit -m "chore: formatting corrections"
            git push
            echo "Code has been formatted and changes have been committed and pushed."
          fi
          echo "All code is properly formatted!"

Metadata

Metadata

Assignees

Labels

repo maintenanceRelated to keeping repo operations smooth

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions