File tree Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 2424 access_token : ${{ github.token }}
2525
2626 analyze :
27+ name : Format, fix & analyze Code
2728 if : ${{ !startsWith(github.ref, 'refs/heads/release/') }}
2829 runs-on : ubuntu-latest
2930 timeout-minutes : 20
3637 if : ${{ inputs.sdk == 'dart' }}
3738 -
uses :
subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # [email protected] 3839 if : ${{ inputs.sdk == 'flutter' }}
40+
3941 - run : ${{ inputs.sdk }} pub get
40- - run : ${{ inputs.sdk }} format --set-exit-if-changed ./
42+
43+ - run : dart format .
44+
45+ - run : dart fix --apply
46+
47+ # actions/checkout fetches only a single commit in a detached HEAD state. Therefore
48+ # we need to pass the current branch, otherwise we can't commit the changes.
49+ # GITHUB_HEAD_REF is the name of the head branch. GitHub Actions only sets this for PRs.
50+ - run : ../scripts/commit-formatted-code.sh $GITHUB_HEAD_REF
4151
4252 - name : dart analyze
4353 uses : invertase/github-action-dart-analyzer@cdd8652b05bf7ed08ffce30f425436780f869f13 # pin@v1
Original file line number Diff line number Diff line change 11// ignore_for_file: invalid_use_of_internal_member
22
3+ import '../sentry_flutter.dart' ;
34import 'package:flutter/widgets.dart' ;
45import 'package:meta/meta.dart' ;
56
6- import '../sentry_flutter.dart' ;
7-
87/// The methods and properties are modelled after the the real binding class.
98@experimental
109class BindingWrapper {
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -euo pipefail
3+
4+ GITHUB_BRANCH=" ${1} "
5+
6+ if [[ $( git status) == * " nothing to commit" * ]]; then
7+ echo " Nothing to commit. All code formatted correctly."
8+ else
9+ echo " Formatted some code. Going to push the changes."
10+ git config --global user.name ' Sentry Github Bot'
11+ git config --global user.email
' [email protected] ' 12+ git fetch
13+ git checkout ${GITHUB_BRANCH}
14+ git commit -am " Format & fix code"
15+ git push --set-upstream origin ${GITHUB_BRANCH}
16+ fi
You can’t perform that action at this time.
0 commit comments