diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml index e015bea8..85aeff05 100644 --- a/.github/workflows/api.yml +++ b/.github/workflows/api.yml @@ -184,9 +184,10 @@ 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: | + false echo -e "### Current benchmark\n\n" >> bench_admin_stats.md && \ pipenv run csvlook -I bench_admin_stats_stamped.csv >> bench_admin_stats.md && \ echo -e "\n### Comparison with the latest previous benchmark\n\n" >> bench_admin_stats.md && \ @@ -197,8 +198,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 +218,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