Files
deepset-ai--haystack/.github/workflows/docstring_labeler_apply.yml
T
wehub-resource-sync c56bef871b
Sync docs with Docusaurus / sync (push) Waiting to run
Tests / Check if changed (push) Waiting to run
Tests / format (push) Blocked by required conditions
Tests / check-imports (push) Blocked by required conditions
Tests / Unit / macos-latest (push) Blocked by required conditions
Tests / Unit / ubuntu-latest (push) Blocked by required conditions
Tests / Unit / windows-latest (push) Blocked by required conditions
Tests / mypy (push) Blocked by required conditions
Tests / Integration / ubuntu-latest (push) Blocked by required conditions
Tests / Integration / macos-latest (push) Blocked by required conditions
Tests / Integration / windows-latest (push) Blocked by required conditions
Tests / notify-slack-on-failure (push) Blocked by required conditions
Tests / Mark tests as completed (push) Blocked by required conditions
Docker image release / Build base image (push) Waiting to run
CodeQL / Analyze (python) (push) Has been cancelled
Update Platform Components Table / update (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:22:28 +08: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@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
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