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

commit 3321a93f75f62a3641a651fda477cccd99f31906
Author: Szymon Czapracki <[email protected]>
AuthorDate: Fri Oct 24 14:19:54 2025 +0200

    ci: Add workflow removing ci label
    
    Remove ci label from workflow.
    Works only for labeled PR's.
---
 .github/workflows/remove_ci_label.yml | 55 +++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/.github/workflows/remove_ci_label.yml 
b/.github/workflows/remove_ci_label.yml
new file mode 100644
index 000000000..1e7246ec4
--- /dev/null
+++ b/.github/workflows/remove_ci_label.yml
@@ -0,0 +1,55 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: Remove informative CI status
+
+on:
+  pull_request:
+    types: [labeled]
+
+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: |
+            try {
+              await github.rest.issues.removeLabel({
+                ...context.repo,
+                issue_number: context.issue.number,
+                name: process.env.LABEL,
+              });
+              core.info(`Removed '${process.env.LABEL}' from PR 
#${context.issue.number}.`);
+            } catch (e) {
+              if (e.status === 404) {
+                core.info(`Label '${process.env.LABEL}' not present; nothing 
to remove.`);
+              } else {
+                throw e;
+              }
+            }

Reply via email to