Skip to content

enhancement(sample transform): Add group tag to discarded event metrics #1913

enhancement(sample transform): Add group tag to discarded event metrics

enhancement(sample transform): Add group tag to discarded event metrics #1913

# Docs review hold — workflow 1/3

Check warning on line 1 in .github/workflows/add_docs_review_label.yml

View workflow run for this annotation

GitHub Actions / Add Docs Review Label

Workflow execution policy warning (evaluate mode)

On November 2, 2026, GitHub will restrict `pull_request_target` on public repositories by default. To continue allowing the event trigger, configure an Actions policy. Learn more: https://gh.io/securely-using-pull_request_target#default-policy-for-pull_request_target
#
# Purpose: avoid pulling the docs team into a PR review before the code is
# directionally approved by a maintainer. This workflow adds
# "docs review on hold" to any PR touching documentation paths, and the label is
# cleared automatically once a MEMBER or OWNER approves (see check_docs_review.yml).
#
# Design is intentionally best-effort. Edge cases such as an approval being later
# dismissed without a new commit are accepted — the label corrects itself on the
# next push. add and check/remove use separate concurrency groups (pr-labels-add-*
# vs pr-labels-check-*) so a new push cannot cancel a pending approval-check run.
# Each workflow independently checks state before acting, so concurrent runs
# across groups are safe.
#
# Currently dedicated to the docs review flow. If a second use case appears, promote
# this into a reusable workflow (`workflow_call`) with the label as an input.
name: Add Docs Review Label
permissions:
pull-requests: write
on:
pull_request_target:
types: [opened, reopened, synchronize]
# Keep these paths in sync with the documentation team entries in .github/CODEOWNERS
paths:
- "*.md"
- "docs/**"
- "deprecation.d/**"
- "website/content/**"
- "website/cue/reference/**"
concurrency:
group: pr-labels-add-${{ github.event.pull_request.number }}
cancel-in-progress: false
env:
LABEL_NAME: "docs review on hold"
jobs:
add_label:
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Check member approval
id: check
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const reviews = await github.paginate(github.rest.pulls.listReviews, {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
per_page: 100,
});
const allowed = ['MEMBER', 'OWNER'];
const approved = reviews.some(r => allowed.includes(r.author_association) && r.state === 'APPROVED');
core.info(`Member approval found: ${approved}`);
core.setOutput('skip', String(approved));
- if: steps.check.outputs.skip != 'true'
uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1.1.3
with:
labels: ${{ env.LABEL_NAME }}