Skip to content

fix workflow

fix workflow #2

Workflow file for this run

on:
workflow_dispatch:
push:
jobs:
cancel-previous-workflow:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # [email protected]
with:
access_token: ${{ github.token }}
format-and-fix:
name: Format & fix code
if: ${{ !startsWith(github.ref, 'refs/heads/release/') }}
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
package: [ dart, flutter, dio, sqflite, logging, file ]
defaults:
run:
working-directory: ${{ matrix.package }}
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1
if: ${{ matrix.package != 'flutter' }}
- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # [email protected]
if: ${{ matrix.package == 'flutter' }}
- run: dart pub get
if: ${{ matrix.package != 'flutter' }}
- run: flutter pub get
if: ${{ matrix.package == 'flutter' }}
- run: dart format .
- run: dart fix --apply
# 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