From 9215d1b2dd65a67ec1a57c8f33bb64c0ecf3e398 Mon Sep 17 00:00:00 2001 From: David Holdeman Date: Thu, 20 Jan 2022 16:56:09 -0600 Subject: [PATCH] Don't skip firmware jobs if workflow is run manually (#3821) * add workflow dispatch and check * single quotes * undo hack --- .github/workflows/build-firmware.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-firmware.yaml b/.github/workflows/build-firmware.yaml index b1d16db4f4..89e315a488 100644 --- a/.github/workflows/build-firmware.yaml +++ b/.github/workflows/build-firmware.yaml @@ -1,6 +1,6 @@ name: FW -on: [push, pull_request] +on: [push, pull_request, workflow_dispatch] jobs: build-firmware: @@ -194,9 +194,9 @@ jobs: steps: - name: Execution throttle early exit - if: ${{ matrix.skip-rate }} - # todo: how do we produce well-defined releases with skip-rate approach? For I can think of hacking the line below before a release - run: if (($(($RANDOM % 100)) < ${{ matrix.skip-rate }})); then echo "skip=not_true" >> $GITHUB_ENV; fi + # Don't skip any jobs if this workflow was run manually. + if: ${{ matrix.skip-rate && github.event_name != 'workflow_dispatch' }} + run: if (($(($RANDOM % 100)) < ${{ matrix.skip-rate }})); then echo "skip=true" >> $GITHUB_ENV; fi - uses: actions/checkout@v1 if: ${{ env.skip != 'true' }}