Skip to content

Remove Triage Label

Remove Triage Label #2

Workflow file for this run

# 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 Triage Label
on:
workflow_dispatch: # Let us run manually
schedule:
- cron: '0 3 * * *' # Run at 3:00 UTC nightly -- just before the "stale.yml" workflow
jobs:
remove-triage:
runs-on: ubuntu-latest
steps:
- name: Env
run: printenv
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
- name: Remove label
uses: actions/github-script@v7
continue-on-error: true
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.paginate("GET /search/issues{?q}", {
q: "repo:apache/kafka label:triage is:pull-request"
})
.then((pulls) => {
pulls.forEach(pull => {
github.request("GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews", {
owner: "apache",
repo: "kafka",
pull_number: pull.number,
headers: {
"X-GitHub-Api-Version": "2022-11-28"
}
}).then((resp) => {
console.log("Found " + resp.data.length + " reviews for PR " + pull.number);
if (resp.data.length > 0) {
console.log("Removing 'triage' label from PR " + pull.number + " : " + pull.title);
github.rest.issues.removeLabel({
owner: "apache",
repo: "kafka",
issue_number: pull.number,
name: "triage"
});
}
});
});
});