From 0a4806ed0c766c5fde52ce45bceaf02fe3ea5af9 Mon Sep 17 00:00:00 2001
From: Anton Kostenko <anton.k@metabase.com>
Date: Wed, 14 Aug 2024 09:34:07 -0400
Subject: [PATCH] Switch Perf test events to labels from comments (#46835)

* Switch Perf test events to labels from comments
---
 .../{perf-test-comment.yml => perf-test-labeled.yml}        | 6 +++---
 .github/workflows/perf-test.yml                             | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
 rename .github/workflows/{perf-test-comment.yml => perf-test-labeled.yml} (64%)

diff --git a/.github/workflows/perf-test-comment.yml b/.github/workflows/perf-test-labeled.yml
similarity index 64%
rename from .github/workflows/perf-test-comment.yml
rename to .github/workflows/perf-test-labeled.yml
index 9e54818a3da..93bdb1c97ef 100644
--- a/.github/workflows/perf-test-comment.yml
+++ b/.github/workflows/perf-test-labeled.yml
@@ -1,8 +1,8 @@
 name: Perf test command
 
 on:
-  issue_comment:
-    types: [created]
+  pull_request:
+    types: [ labeled ]
 
 concurrency:
   group: ${{ github.workflow }}-${{ github.ref }}
@@ -10,7 +10,7 @@ concurrency:
 
 jobs:
   run-perf-test:
-    if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/perf') }}
+    if: ${{ github.event.label.name == 'Run-perf' }}
     uses: ./.github/workflows/perf-test.yml
     with:
       wait_for_uberjar: true
diff --git a/.github/workflows/perf-test.yml b/.github/workflows/perf-test.yml
index e0d7d60dc22..4456b975ad1 100644
--- a/.github/workflows/perf-test.yml
+++ b/.github/workflows/perf-test.yml
@@ -75,7 +75,7 @@ jobs:
   launch_perf_test:
     needs: [ build ]
     runs-on: ubuntu-latest
-    name: PR Review ENV
+    name: Launch Perf Test
     permissions:
       id-token: write
       contents: read
-- 
GitLab