From d9a60a4fa1b99993309d6fcc437dd839df2f3b0a Mon Sep 17 00:00:00 2001 From: JTorkk Date: Mon, 24 Aug 2026 22:49:31 +0300 Subject: [PATCH 1/2] ci: format code on pull requests and run only on PRs The add-and-commit step failed with "fatal: You are not currently on a branch". actions/checkout defaults to a detached HEAD, and on pull_request it checks out the merge ref rather than the source branch, so there was nothing to push formatting fixes back to. Check the branch out by name with `ref: github.head_ref` so the step has a real branch, and grant the job `contents: write` so it can push. The step is guarded to pull_request, since workflow_dispatch has no head_ref. Also drops the push-to-main trigger so CI runs on pull requests only, and bumps actions/checkout to v4 (v3 runs on a Node version GitHub is deprecating). Verified locally: pub get, dart format (0 changed), analyze --fatal-infos, and all 132 tests pass. --- .flutter-plugins-dependencies | 2 +- .github/workflows/flutter_ci.yaml | 35 +++++++++++++++++++++---------- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index e08e077..0e68e90 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/home/runner/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"mobile_scanner","path":"/home/runner/.pub-cache/hosted/pub.dev/mobile_scanner-7.2.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"screen_capture_event","path":"/home/runner/.pub-cache/hosted/pub.dev/screen_capture_event-1.2.0/","native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"connectivity_plus","path":"/home/runner/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"mobile_scanner","path":"/home/runner/.pub-cache/hosted/pub.dev/mobile_scanner-7.2.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"screen_capture_event","path":"/home/runner/.pub-cache/hosted/pub.dev/screen_capture_event-1.2.0/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"connectivity_plus","path":"/home/runner/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"mobile_scanner","path":"/home/runner/.pub-cache/hosted/pub.dev/mobile_scanner-7.2.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"connectivity_plus","path":"/home/runner/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","native_build":false,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"connectivity_plus","path":"/home/runner/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[{"name":"connectivity_plus","path":"/home/runner/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","dependencies":[],"dev_dependency":false},{"name":"mobile_scanner","path":"/home/runner/.pub-cache/hosted/pub.dev/mobile_scanner-7.2.0/","dependencies":[],"dev_dependency":false}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":[]},{"name":"mobile_scanner","dependencies":[]},{"name":"screen_capture_event","dependencies":[]}],"date_created":"2026-08-24 19:45:14.246743","version":"3.44.2","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"mobile_scanner","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/mobile_scanner-7.2.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"screen_capture_event","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/screen_capture_event-1.2.0/","native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"connectivity_plus","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"mobile_scanner","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/mobile_scanner-7.2.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"screen_capture_event","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/screen_capture_event-1.2.0/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"connectivity_plus","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"mobile_scanner","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/mobile_scanner-7.2.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"connectivity_plus","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","native_build":false,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"connectivity_plus","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[{"name":"connectivity_plus","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","dependencies":[],"dev_dependency":false},{"name":"mobile_scanner","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/mobile_scanner-7.2.0/","dependencies":[],"dev_dependency":false}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":[]},{"name":"mobile_scanner","dependencies":[]},{"name":"screen_capture_event","dependencies":[]}],"date_created":"2026-08-24 22:49:15.601749","version":"3.44.2","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file diff --git a/.github/workflows/flutter_ci.yaml b/.github/workflows/flutter_ci.yaml index fafd880..9018563 100644 --- a/.github/workflows/flutter_ci.yaml +++ b/.github/workflows/flutter_ci.yaml @@ -2,20 +2,25 @@ name: '[CI]' on: pull_request: - # Also run on direct pushes to main. Without this, anything pushed straight - # to main skips CI entirely - which is how the encrypt 5.0.3 IV regression - # shipped despite the existing round-trip tests catching it. - push: - branches: [main] workflow_dispatch: jobs: ci: runs-on: ubuntu-latest + # Required by the add-and-commit step at the end. + permissions: + contents: write + steps: - - uses: actions/checkout@v3 - + - uses: actions/checkout@v4 + with: + # actions/checkout defaults to a detached HEAD - on pull_request it + # checks out the merge ref rather than the source branch - which made + # the commit step fail with "You are not currently on a branch". + # Checking the branch out by name gives it somewhere to push back to. + ref: ${{ github.head_ref }} + - uses: subosito/flutter-action@v2 with: flutter-version: "3.44.2" @@ -26,10 +31,14 @@ jobs: - name: Install dependencies run: flutter pub get - # NOTE: `dart format --fix` was removed in newer Dart SDKs; formatting - # is written in place by default. Applying lint fixes is now a separate + # Formats in place; the commit step at the end pushes any changes back to + # the PR branch so the package's style stays consistent automatically. + # + # NOTE: `dart format --fix` no longer exists - the flag was removed from + # newer Dart SDKs and made this step fail with exit code 64. Formatting + # is written in place by default, and applying lint fixes is a separate # command (`dart fix --apply`). - - name: Verify formatting + - name: Format code run: dart format . - name: Analyze project source @@ -38,8 +47,12 @@ jobs: - name: Run tests run: flutter test --no-pub + # Only meaningful on pull_request, where github.head_ref is set and the + # branch was checked out by name above. On workflow_dispatch there is no + # branch to push to. - uses: EndBug/add-and-commit@v9 + if: github.event_name == 'pull_request' with: - message: Formats code + message: 'chore: formats code' committer_name: GitHub Actions committer_email: actions@github.com From 7e74f5347a9e19d4efc34a3703e8a63573e7e45b Mon Sep 17 00:00:00 2001 From: JTorkk Date: Mon, 24 Aug 2026 19:50:53 +0000 Subject: [PATCH 2/2] chore: formats code --- .flutter-plugins-dependencies | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 0e68e90..a6afcdc 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"mobile_scanner","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/mobile_scanner-7.2.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"screen_capture_event","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/screen_capture_event-1.2.0/","native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"connectivity_plus","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"mobile_scanner","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/mobile_scanner-7.2.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"screen_capture_event","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/screen_capture_event-1.2.0/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"connectivity_plus","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"mobile_scanner","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/mobile_scanner-7.2.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"connectivity_plus","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","native_build":false,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"connectivity_plus","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[{"name":"connectivity_plus","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","dependencies":[],"dev_dependency":false},{"name":"mobile_scanner","path":"/Users/juhotorkkeli/.pub-cache/hosted/pub.dev/mobile_scanner-7.2.0/","dependencies":[],"dev_dependency":false}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":[]},{"name":"mobile_scanner","dependencies":[]},{"name":"screen_capture_event","dependencies":[]}],"date_created":"2026-08-24 22:49:15.601749","version":"3.44.2","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/home/runner/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"mobile_scanner","path":"/home/runner/.pub-cache/hosted/pub.dev/mobile_scanner-7.2.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"screen_capture_event","path":"/home/runner/.pub-cache/hosted/pub.dev/screen_capture_event-1.2.0/","native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"connectivity_plus","path":"/home/runner/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"mobile_scanner","path":"/home/runner/.pub-cache/hosted/pub.dev/mobile_scanner-7.2.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"screen_capture_event","path":"/home/runner/.pub-cache/hosted/pub.dev/screen_capture_event-1.2.0/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"connectivity_plus","path":"/home/runner/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"mobile_scanner","path":"/home/runner/.pub-cache/hosted/pub.dev/mobile_scanner-7.2.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"connectivity_plus","path":"/home/runner/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","native_build":false,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"connectivity_plus","path":"/home/runner/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[{"name":"connectivity_plus","path":"/home/runner/.pub-cache/hosted/pub.dev/connectivity_plus-7.1.1/","dependencies":[],"dev_dependency":false},{"name":"mobile_scanner","path":"/home/runner/.pub-cache/hosted/pub.dev/mobile_scanner-7.2.0/","dependencies":[],"dev_dependency":false}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":[]},{"name":"mobile_scanner","dependencies":[]},{"name":"screen_capture_event","dependencies":[]}],"date_created":"2026-08-24 19:50:10.993714","version":"3.44.2","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file