This commit is contained in:
Zane Schepke 2024-11-03 17:11:06 -05:00
parent d70ef658e2
commit 7b443add3a
2 changed files with 16 additions and 18 deletions

View File

@ -34,29 +34,28 @@ on:
jobs: jobs:
check_commits: check_commits:
name: Check for New Commits
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs:
has_new_commits: ${{ steps.check.outputs.new_commits }}
steps: steps:
- name: Checkout repository - name: Checkout Repository
uses: actions/checkout@v2 uses: actions/checkout@v3
with:
fetch-depth: 0 # This fetches all history so we can check commits
- name: Check for new commits in the last 23 hours - name: Check for new commits
id: check_commits id: check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
# Get the current time and the time 23 hours ago in ISO 8601 format # This script checks for commits newer than 23 hours ago
now=$(date --utc +%Y-%m-%dT%H:%M:%SZ) NEW_COMMITS=$(git rev-list --count --after="$(date -Iseconds -d '23 hours ago')" ${{ github.sha }})
past=$(date --utc --date='23 hours ago' +%Y-%m-%dT%H:%M:%SZ) echo "new_commits=$NEW_COMMITS" >> $GITHUB_OUTPUT
# Fetch commit history and check for commits in the last 23 hours
if git rev-list --since="$past" --count HEAD > /dev/null; then
echo "New commits found in the last 23 hours."
echo "::set-output name=new_commits::true"
else
echo "No new commits found in the last 23 hours."
echo "::set-output name=new_commits::false"
fi
build: build:
needs: check_commits needs: check_commits
if: ${{ needs.check_commits.outputs.new_commits == 'true' && inputs.track != 'none' }} if: ${{ needs.check_commits.outputs.has_new_commits == 'true' && inputs.release_type != 'none' }}
name: Build Signed APK name: Build Signed APK
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:

View File

@ -60,7 +60,6 @@ class TunnelControlTile : TileService(), LifecycleOwner {
private suspend fun updateTileState() { private suspend fun updateTileState() {
val lastActive = appDataRepository.getStartTunnelConfig() val lastActive = appDataRepository.getStartTunnelConfig()
Timber.d("Got config $lastActive")
lastActive?.let { lastActive?.let {
updateTile(it) updateTile(it)
} }