Copilot commented on code in PR #31: URL: https://github.com/apache/iceberg-verification/pull/31#discussion_r4622891365
########## .github/workflows/pr-labeler.yml: ########## @@ -0,0 +1,72 @@ +# 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. + +# Applies the label for each title prefix listed in the "Pull request titles" +# section of CONTRIBUTING.md, and removes prefix labels the title no longer has. +# pull_request_target is needed so that pull requests from forks can be +# labeled. It is safe here because the job never checks out the pull request +# and reads the title only through the environment. +name: "Pull Request Labeler" + +on: + pull_request_target: # zizmor: ignore[dangerous-triggers] + types: [opened, edited, reopened] + +permissions: + pull-requests: write + +jobs: + label: + name: Label from title prefix + runs-on: ubuntu-24.04 + steps: + - name: Sync labels with the title prefix + env: + GH_TOKEN: ${{ github.token }} + REPO: ${{ github.repository }} + PR_NUMBER: ${{ github.event.pull_request.number }} + TITLE: ${{ github.event.pull_request.title }} + run: | Review Comment: Overlapping runs can leave labels matching an outdated title because each run uses its event's title snapshot. For example, if a PR changes from `Fixture: ...` to `Tooling: ...`, a delayed `opened` run can remove `tooling` and restore `fixtures` after the edit's run finishes, with no subsequent event to correct it. Serialize label updates per PR and fetch the current title when the job executes so delayed runs cannot restore stale labels. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
