This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new 21d15bf90ee HDDS-13777. Change label-pr workflow to avoid
pull_request_target (#9808)
21d15bf90ee is described below
commit 21d15bf90ee86c8ad1a3d0e3bf279f1a8aff7171
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Tue Feb 24 11:08:32 2026 +0100
HDDS-13777. Change label-pr workflow to avoid pull_request_target (#9808)
---
.github/workflows/label-pr.yml | 34 ++++++++++++++++++----
.../schedule-label-pr.yml} | 15 +++++++---
2 files changed, 40 insertions(+), 9 deletions(-)
diff --git a/.github/workflows/label-pr.yml b/.github/workflows/label-pr.yml
index abc620b7ef0..8838cab472e 100644
--- a/.github/workflows/label-pr.yml
+++ b/.github/workflows/label-pr.yml
@@ -13,10 +13,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# This workflow reads its configuration from the .github/labeler.yml file.
-name: pull-request-labeler
+# This workflow applies labels for PRs targeted at feature branches.
+
+name: label-pull-requests
+
on:
-- pull_request_target
+ workflow_call:
+ # allow running the workflow manually from GitHub UI
+ workflow_dispatch:
jobs:
labeler:
@@ -24,6 +28,26 @@ jobs:
contents: read
pull-requests: write
runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ include:
+ # branch -> label rules
+ - branch: HDDS-14496-zdu
+ label: zdu
+ fail-fast: false
steps:
- - uses: actions/labeler@v5
-
+ - name: "Checkout project" # required for `gh` CLI
+ uses: actions/checkout@v4
+ with:
+ persist-credentials: false
+ sparse-checkout: |
+ .github
+ - name: "Add label ${{ matrix.label }} to PRs for ${{ matrix.branch }}"
+ run: |
+ gh pr list --base "$BRANCH" --search "-label:$LABEL" --json number
--jq '.[].number' \
+ | xargs --max-args 1 --no-run-if-empty gh pr edit --add-label
"$LABEL"
+ env:
+ # use variables to sanitize input
+ BRANCH: ${{ matrix.branch }}
+ LABEL: ${{ matrix.label }}
+ GH_TOKEN: ${{ github.token }}
diff --git a/.github/labeler.yml b/.github/workflows/schedule-label-pr.yml
similarity index 77%
rename from .github/labeler.yml
rename to .github/workflows/schedule-label-pr.yml
index 24dc55c7fa2..64a4a298388 100644
--- a/.github/labeler.yml
+++ b/.github/workflows/schedule-label-pr.yml
@@ -13,9 +13,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Configuration for .github/workflows/label-pr.yml
+# This workflow periodically applies labels for PRs.
-# This rule can be deleted once the zero downtime upgrade feature branch is
merged.
-zdu:
-- base-branch: HDDS-14496-zdu
+name: scheduled-label-pull-requests
+on:
+ # every 5 minutes
+ schedule:
+ - cron: '*/5 * * * *'
+
+jobs:
+ label:
+ uses: ./.github/workflows/label-pr.yml
+ secrets: inherit
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]