diff --git a/.github/workflows/tilt.yml b/.github/workflows/tilt.yml index ad9e17345bf..5e1a1b6ec9b 100644 --- a/.github/workflows/tilt.yml +++ b/.github/workflows/tilt.yml @@ -2,6 +2,8 @@ name: "Tilt CI" on: pull_request: branches: [ main ] + types: [opened, synchronize, labeled, unlabeled] + jobs: tests: runs-on: ubuntu-latest @@ -10,5 +12,21 @@ jobs: - uses: cachix/install-nix-action@v22 with: github_access_token: ${{ secrets.GITHUB_TOKEN }} + - name: Prepare tilt args from labels + id: prepare_args + run: | + ARGS="" + cat < labels.json + ${{ toJSON(github.event.pull_request.labels.*.name) }} + EOF + for LABEL in $(jq -r '.[]' < labels.json); do + case "$LABEL" in + dashboard|consent) + ARGS+=" $LABEL" + ;; + esac + done + echo "Prepared args: $ARGS" + echo "args=$ARGS" >> "$GITHUB_OUTPUT" - name: Tilt CI - run: nix develop -c bash -c "cd dev && xvfb-run tilt ci -- --test consent" + run: nix develop -c bash -c "cd dev && xvfb-run tilt ci -- --test ${{ steps.prepare_args.outputs.args }}"