Skip to content

[CELEBORN-2016] Fix the worker decommission and graceful shutdown condition #2315

[CELEBORN-2016] Fix the worker decommission and graceful shutdown condition

[CELEBORN-2016] Fix the worker decommission and graceful shutdown condition #2315

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: Pull Request Labeler
on:
pull_request_target:
types: [opened, edited, synchronize, labeled, unlabeled, reopened]
jobs:
labeler:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/labeler@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
sync-labels: true
correctness-label:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Apply or remove correctness label
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_BODY: ${{ github.event.pull_request.body }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
run: |
# Extract only the correctness section (up to the next ### heading).
# PR_BODY is passed via env so it never touches the shell command string.
section=$(printf '%s' "$PR_BODY" | awk '
/Does this PR resolve a correctness bug/ { found=1 }
found && /^###/ && !/Does this PR resolve/ { exit }
found { print }
')
if printf '%s' "$section" | grep -iqE -- '^\s*-\s*\[\s*[xX]\s*\]\s*yes\s*$'; then
gh pr edit "$PR_NUMBER" --repo "$REPO" --add-label "correctness"
else
gh pr edit "$PR_NUMBER" --repo "$REPO" --remove-label "correctness" 2>/dev/null || true
fi