Skip to content

[fix](dml) Enforce partition guard for delete #86741

[fix](dml) Enforce partition guard for delete

[fix](dml) Enforce partition guard for delete #86741

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: 'Check PR title'
on:
pull_request:
types: [ opened, edited ]
permissions:
contents: read
pull-requests: read
jobs:
PR-title-checker:
name: "PR title checker"
runs-on: ubuntu-latest
steps:
- name: Check Title
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
TITLE="$(jq -r '.pull_request.title // empty' "$GITHUB_EVENT_PATH")"
PR_NUM="$(jq -r '.pull_request.number // empty' "$GITHUB_EVENT_PATH")"
if [[ -z "${TITLE}" || -z "${PR_NUM}" ]]; then
echo "::error::Unable to read the pull request title from the event payload."
exit 1
fi
# Same regex as the previously used deepakputhraya/action-pr-title submodule.
if ! grep -qE '\[([a-zA-Z0-9 \-_])+\]\(([a-zA-Z0-9 \-_])+\)(.*)' <<< "${TITLE}"; then
echo "::error::PR title \"${TITLE}\" does not match the required pattern: [type](scope) description"
gh pr comment "${PR_NUM}" --body "PR title \`${TITLE}\` does not match the required pattern: \`[type](scope) description\`"
exit 1
fi