diff --git a/.github/workflows/pr-policy.yml b/.github/workflows/pr-policy.yml index 650e416..547df63 100644 --- a/.github/workflows/pr-policy.yml +++ b/.github/workflows/pr-policy.yml @@ -1,7 +1,9 @@ name: PR Policy -# Enforces PR requirements before merge. Make the "Milestone assigned" check required -# (repo ruleset / branch protection) so it actually blocks merging. +# Thin caller — the policy logic lives in +# pimcore/workflows-collection-public/.github/workflows/reusable-pr-policy.yml +# and changes there apply automatically. Make the "PR Policy / Milestone assigned" +# check required (repo ruleset / branch protection) so it actually blocks merging. on: pull_request: @@ -12,31 +14,17 @@ on: - ready_for_review - milestoned - demilestoned + - labeled + - unlabeled permissions: contents: read -jobs: - milestone: - name: Milestone assigned - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - - steps: - - name: Check milestone - env: - MILESTONE: ${{ github.event.pull_request.milestone.title }} - AUTHOR: ${{ github.event.pull_request.user.login }} - run: | - # Automated sync PRs (repo-file-sync-action) never carry a milestone. - if [ "$AUTHOR" = "pimcore-deployments" ]; then - echo "Skipping milestone check for automated PR by $AUTHOR" - exit 0 - fi +concurrency: + group: pr-policy-${{ github.event.pull_request.number }} + cancel-in-progress: true - if [ -z "$MILESTONE" ]; then - echo "::error::A milestone must be assigned before this pull request can be merged." - exit 1 - fi - - echo "Milestone assigned: $MILESTONE" +jobs: + pr-policy: + name: PR Policy + uses: pimcore/workflows-collection-public/.github/workflows/reusable-pr-policy.yml@main