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

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 68c77f7a7 ci: Remove env variable from workflow
68c77f7a7 is described below

commit 68c77f7a75beacf7ff3cde7e1ee01d24d4bc4c40
Author: Szymon Czapracki <[email protected]>
AuthorDate: Fri Oct 24 15:20:22 2025 +0200

    ci: Remove env variable from workflow
    
    Using env variables in workflow is quirky.
    Instead make condition use plain literal.
    Change trigger option, previously labeled
    action triggered this, we don't want this.
---
 .github/workflows/remove_ci_label.yml | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/remove_ci_label.yml 
b/.github/workflows/remove_ci_label.yml
index 1e7246ec4..de70a267b 100644
--- a/.github/workflows/remove_ci_label.yml
+++ b/.github/workflows/remove_ci_label.yml
@@ -19,36 +19,45 @@
 
 name: Remove informative CI status
 
-on:
-  pull_request:
-    types: [labeled]
+on: [push, pull_request]
 
 permissions:
   contents: read
   issues: write
   pull-requests: write
 
-env:
-  LABEL: needs-ci-approval
-
 jobs:
   remove-ci-label:
-    if: ${{ github.event.label.name == env.LABEL }}
     runs-on: ubuntu-latest
     steps:
       - uses: actions/github-script@v7
         with:
           script: |
+            const label = 'needs-ci-approval';
+
+            // List current labels on the PR
+            const { data: labels } = await 
github.rest.issues.listLabelsOnIssue({
+              ...context.repo,
+              issue_number: context.issue.number,
+            });
+
+            const hasLabel = labels.some(l => l.name === label);
+            if (!hasLabel) {
+              core.info(`'${label}' not present — nothing to do.`);
+              return;
+            }
+
+            // Remove the label if present
             try {
               await github.rest.issues.removeLabel({
                 ...context.repo,
                 issue_number: context.issue.number,
-                name: process.env.LABEL,
+                name: label,
               });
-              core.info(`Removed '${process.env.LABEL}' from PR 
#${context.issue.number}.`);
+              core.info(`Removed '${label}' from PR 
#${context.issue.number}.`);
             } catch (e) {
               if (e.status === 404) {
-                core.info(`Label '${process.env.LABEL}' not present; nothing 
to remove.`);
+                core.info(`'${label}' already gone.`);
               } else {
                 throw e;
               }

Reply via email to