From d4f799299a7835fc68b45e52907879d6ac6b42e6 Mon Sep 17 00:00:00 2001 From: Julien Maupetit Date: Wed, 4 Dec 2024 16:36:16 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7(api)=20fix=20conditional=20steps/j?= =?UTF-8?q?obs=20execution=20to=20update=20bench=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dealing with conditions can be tricky. Previous conditions failed as github.event.pull_request.merged is null when merging to main. --- .github/workflows/api.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml index e015bea8..a6623332 100644 --- a/.github/workflows/api.yml +++ b/.github/workflows/api.yml @@ -184,8 +184,8 @@ jobs: name: api-admin-benchmark path: ./src/api/bench_admin_stats_stamped.csv - name: Generate markdown table - # Only when in PR, not when merged - if: github.event.pull_request.merged == false + # Only when in PR, not when merged to main + if: ${{ github.event_name == 'pull_request' }} run: | echo -e "### Current benchmark\n\n" >> bench_admin_stats.md && \ pipenv run csvlook -I bench_admin_stats_stamped.csv >> bench_admin_stats.md && \ @@ -197,8 +197,8 @@ jobs: csvlook -I >> bench_admin_stats.md cat bench_admin_stats.md - uses: actions/github-script@v7 - # Only when in PR, not when merged - if: github.event.pull_request.merged == false + # Only when in PR, not when merged to main + if: ${{ github.event_name == 'pull_request' }} with: script: | const fs = require('node:fs'); @@ -217,7 +217,7 @@ jobs: # Only when a PR is merged update-bench-db: - if: github.event.pull_request.merged == true + if: ${{ github.event_name == 'push' }} needs: - build-api - bench-api