Files
haystack/.github/workflows/docstring_labeler_apply.yml
dependabot[bot] 6a76cdc3b3 build(deps): bump actions/download-artifact from 8.0.1 to 8.0.2 (#13185)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-08 16:32:02 +02:00

43 lines
1.3 KiB
YAML

name: Apply docstrings label
# Runs after "Detect docstrings edit" completes. This workflow holds the write
# token but only consumes the data artifact produced by the untrusted run — it
# never checks out PR code, so it is safe under the workflow_run trigger.
on:
workflow_run:
workflows: ["Detect docstrings edit"]
types:
- completed
permissions:
contents: read
jobs:
label:
runs-on: ubuntu-slim
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
permissions:
contents: read
pull-requests: write
actions: read
steps:
- name: Download result
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: docstring-label-result
path: result
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Add label
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
SHOULD_LABEL=$(cat result/should_label)
PR_NUMBER=$(cat result/pr_number)
if [ "$SHOULD_LABEL" = "true" ]; then
gh pr edit "$PR_NUMBER" --repo "${{ github.repository }}" --add-label "type:documentation"
else
echo "Docstrings unchanged, nothing to label."
fi