diff --git a/.github/workflows/dart_package.yml b/.github/workflows/dart_package.yml index d3b240d..4d79aa5 100644 --- a/.github/workflows/dart_package.yml +++ b/.github/workflows/dart_package.yml @@ -137,14 +137,17 @@ jobs: runs-on: ${{inputs.runs_on}} timeout-minutes: ${{inputs.timeout_minutes}} + env: + # Cognitive complexity resolves a merge base against the diff base, + # which requires full history. Other runs keep a shallow clone. Values + # are strings because the number `0` is falsy in expressions. + FETCH_DEPTH: ${{inputs.run_cognitive_complexity && '0' || '1'}} + steps: - name: 📚 Git Checkout uses: actions/checkout@v7 with: - # Cognitive complexity resolves a merge base against the diff base, - # which requires full history. Other runs keep the default shallow - # clone for speed. - fetch-depth: ${{ inputs.run_cognitive_complexity && 0 || 1 }} + fetch-depth: ${{env.FETCH_DEPTH}} - name: 🎯 Setup Dart uses: dart-lang/setup-dart@v1.8.1 diff --git a/.github/workflows/flutter_package.yml b/.github/workflows/flutter_package.yml index 25cda23..0dd457e 100644 --- a/.github/workflows/flutter_package.yml +++ b/.github/workflows/flutter_package.yml @@ -150,14 +150,17 @@ jobs: runs-on: ${{inputs.runs_on}} timeout-minutes: ${{inputs.timeout_minutes}} + env: + # Cognitive complexity resolves a merge base against the diff base, + # which requires full history. Other runs keep a shallow clone. Values + # are strings because the number `0` is falsy in expressions. + FETCH_DEPTH: ${{inputs.run_cognitive_complexity && '0' || '1'}} + steps: - name: 📚 Git Checkout uses: actions/checkout@v7 with: - # Cognitive complexity resolves a merge base against the diff base, - # which requires full history. Other runs keep the default shallow - # clone for speed. - fetch-depth: ${{ inputs.run_cognitive_complexity && 0 || 1 }} + fetch-depth: ${{env.FETCH_DEPTH}} - name: 🐦 Setup Flutter uses: subosito/flutter-action@v2.23.0