diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0d2d4fe..30010aa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,25 +33,23 @@ on: workflow_call: jobs: - check_date: + check-commits: runs-on: ubuntu-latest - name: Check latest commit outputs: - should_run: ${{ steps.should_run.outputs.should_run }} + has_new_commits: ${{ steps.commits_check.outputs.has-new-commits }} steps: - - uses: actions/checkout@v4 - - name: print latest_commit - run: echo ${{ github.sha }} - - id: should_run - continue-on-error: true - name: check latest commit is less than a day - if: ${{ github.event_name == 'schedule' }} - run: test -z $(git rev-list --after="23 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false" + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 # Fetch all history for all branches and tags + - name: Check for commits in the last 23 hours + id: commits_check + run: | + commits=$(git rev-list --after="23 hours" HEAD --count) + echo "::set-output name=has-new-commits::$(($commits > 0))" build: - needs: check_date - if: | - github.event_name != 'schedule' || - (needs.check_date.outputs.should_run == 'true' && github.event_name == 'schedule') + needs: check-commits + if: ${{ needs.check-commits.outputs.has_new_commits == 'true' || github.event_name != 'schedule' }} name: Build Signed APK runs-on: ubuntu-latest env: diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/components/TunnelRowItem.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/components/TunnelRowItem.kt index cf8201a..6cd35fe 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/components/TunnelRowItem.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/components/TunnelRowItem.kt @@ -88,7 +88,7 @@ fun TunnelRowItem( } }, isExpanded = expanded && isActive, - expanded = { if (isActive && expanded) TunnelStatisticsBox(vpnState.statistics, tunnel) }, + expanded = { if (isActive && expanded) TunnelStatisticsRow(vpnState.statistics, tunnel) }, focusRequester = focusRequester, trailing = { if ( diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/components/TunnelStatisticsBox.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/components/TunnelStatisticsRow.kt similarity index 97% rename from app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/components/TunnelStatisticsBox.kt rename to app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/components/TunnelStatisticsRow.kt index f2cd4fe..e342825 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/components/TunnelStatisticsBox.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/main/components/TunnelStatisticsRow.kt @@ -19,7 +19,7 @@ import com.zaneschepke.wireguardautotunnel.util.NumberUtils import com.zaneschepke.wireguardautotunnel.util.extensions.toThreeDecimalPlaceString @Composable -fun TunnelStatisticsBox(statistics: TunnelStatistics?, tunnelConfig: TunnelConfig) { +fun TunnelStatisticsRow(statistics: TunnelStatistics?, tunnelConfig: TunnelConfig) { val config = TunnelConfig.configFromAmQuick(tunnelConfig.wgQuick) Row(