Skip to content

Commit bc15bf9

Browse files
committed
improve clarity: when build is skipped, run is canceled no green check mark is shown (#472)
1 parent 08ea61c commit bc15bf9

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

.github/workflows/build_loop_auto.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,30 @@ jobs:
148148
echo "is_second_instance=false" >> "$GITHUB_OUTPUT"
149149
fi
150150
151+
# When a scheduled run finds nothing new to build, cancel the run so it shows
152+
# as "cancelled" instead of "success" — a green check should always mean a
153+
# new build was made.
154+
cancel_when_no_build:
155+
needs: check_status
156+
name: Cancel run when there is nothing to build
157+
runs-on: ubuntu-latest
158+
permissions:
159+
actions: write
160+
if: |
161+
github.event_name == 'schedule' &&
162+
!(vars.SCHEDULED_BUILD != 'false' && needs.check_status.outputs.IS_SECOND_IN_MONTH == 'true') &&
163+
!(vars.SCHEDULED_SYNC != 'false' && needs.check_status.outputs.NEW_COMMITS == 'true')
164+
steps:
165+
- name: Cancel the run
166+
env:
167+
GH_TOKEN: ${{ github.token }}
168+
run: |
169+
echo "Repository is up to date and no monthly build is due — cancelling this run so it is not reported as a successful build." >> "$GITHUB_STEP_SUMMARY"
170+
gh run cancel ${{ github.run_id }} --repo ${{ github.repository }}
171+
# Keep the job alive until the cancellation lands, so the run ends as
172+
# "cancelled" rather than completing successfully first.
173+
sleep 300
174+
151175
# Checks if Distribution certificate is present and valid, optionally nukes and
152176
# creates new certs if the repository variable ENABLE_NUKE_CERTS == 'true'
153177
# only run if a build is planned

fastlane/testflight.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ These instructions allow you to build your app without having access to a Mac.
1212
> The browser build **defaults to** automatically updating and building a new version of Loop according to this schedule:
1313
> - automatically checks for updates weekly and if updates are found, it will build a new version of the app
1414
> - even when there are no updates, it builds on the second Sunday of the month
15-
> - with each scheduled weekly run, a successful build log appears - if the time is very short, it did not need to build - only the long actions (>20 minutes) built a new app
15+
> - if a scheduled run finds nothing new to build, the run is cancelled and shows as cancelled (grey) in the Actions list - a green check always means a new build was made and uploaded to TestFlight
1616
>
1717
> The [**Optional**](#optional) section provides instructions to modify the default behavior if desired.
1818

0 commit comments

Comments
 (0)