This is an automated email from the ASF dual-hosted git repository.

dpgaspar pushed a commit to branch fix/ci-ephemeral-use-labels
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/fix/ci-ephemeral-use-labels by 
this push:
     new 21a11edf11 fix 1
21a11edf11 is described below

commit 21a11edf1166f23de73ae5302651d21afc7c61f8
Author: Daniel Gaspar <[email protected]>
AuthorDate: Tue Jan 28 11:44:45 2025 +0000

    fix 1
---
 .github/workflows/ephemeral-env.yml | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/ephemeral-env.yml 
b/.github/workflows/ephemeral-env.yml
index f849621f9f..8c86614f53 100644
--- a/.github/workflows/ephemeral-env.yml
+++ b/.github/workflows/ephemeral-env.yml
@@ -38,7 +38,15 @@ jobs:
       - name: Check for the "testenv-up" label
         id: eval-label
         run: |
-          if [[ "${{ github.event.label.name }}" == "testenv-up" ]]; then
+          if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
+            LABEL_NAME="${{ github.event.inputs.label_name }}"
+          else
+            LABEL_NAME="${{ github.event.label.name }}"
+          fi
+
+          echo "Evaluating label: $LABEL_NAME"
+
+          if [[ "$LABEL_NAME" == "testenv-up" ]]; then
             echo "result=up" >> $GITHUB_OUTPUT
           else
             echo "result=noop" >> $GITHUB_OUTPUT
@@ -50,11 +58,20 @@ jobs:
         id: get-pr-info
         with:
           script: |
+            const pull_number = context.payload.pull_request
+              ? context.payload.pull_request.number
+              : context.payload.inputs.issue_number;
+
+            if (!pull_number) {
+              throw new Error("Pull request number is not available.");
+            }
+
             const pr = await github.rest.pulls.get({
               owner: context.repo.owner,
               repo: context.repo.repo,
-              pull_number: context.payload.pull_request.number,
+              pull_number,
             });
+
             return pr.data;
 
       - name: Check if a commit was pushed after PR was labeled

Reply via email to