Skip to content

chore(deps): update jinja2 requirement from <4.0,>=3.1 to >=3.1.6,<4.0 in /site-template #93

chore(deps): update jinja2 requirement from <4.0,>=3.1 to >=3.1.6,<4.0 in /site-template

chore(deps): update jinja2 requirement from <4.0,>=3.1 to >=3.1.6,<4.0 in /site-template #93

Workflow file for this run

name: Label PRs
on:
pull_request:
types: [opened, synchronize]
permissions: {}
jobs:
label:
name: Auto-label by path
runs-on: ubuntu-latest
# Fork PRs get a read-only token, so labeling cannot succeed there.
if: github.event.pull_request.head.repo.full_name == github.repository
permissions:
contents: read
pull-requests: write
steps:
- name: Apply labels by changed path
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
FILES="$(gh pr diff "$PR_NUMBER" --name-only)"
LABELS=""
if echo "$FILES" | grep -q "^standards/"; then
LABELS="$LABELS standards"
fi
if echo "$FILES" | grep -q "^scaffold/"; then
LABELS="$LABELS scaffold"
fi
if echo "$FILES" | grep -q "^docs/"; then
LABELS="$LABELS documentation"
fi
if echo "$FILES" | grep -q "^registry.json"; then
LABELS="$LABELS registry"
fi
if echo "$FILES" | grep -q "^\.github/"; then
LABELS="$LABELS ci"
fi
if [ -z "$LABELS" ]; then
echo "No labels to apply"
exit 0
fi
EXISTING="$(gh label list --limit 200 --json name --jq '.[].name')"
for label in $LABELS; do
# Create only when missing, so existing label colors are kept.
if ! printf '%s\n' "$EXISTING" | grep -qx "$label"; then
gh label create "$label" --color "ededed" || true
fi
gh pr edit "$PR_NUMBER" --add-label "$label"
done
echo "Applied labels:$LABELS"