Repository navigation
feat: add wooden-bucket and wall-torch showcase pieces #164
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Label PRs | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| label: | |
| name: Auto-label by path | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Get changed files | |
| id: changed | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| FILES=$(gh pr diff ${{ github.event.pull_request.number }} --name-only) | |
| echo "files<<EOF" >> "$GITHUB_OUTPUT" | |
| echo "$FILES" >> "$GITHUB_OUTPUT" | |
| echo "EOF" >> "$GITHUB_OUTPUT" | |
| - name: Apply labels | |
| env: | |
| FILES: ${{ steps.changed.outputs.files }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| LABELS="" | |
| if echo "$FILES" | grep -q "^skills/"; then | |
| LABELS="$LABELS skills" | |
| fi | |
| if echo "$FILES" | grep -q "^rules/"; then | |
| LABELS="$LABELS rules" | |
| fi | |
| if echo "$FILES" | grep -q "^snippets/"; then | |
| LABELS="$LABELS snippets" | |
| fi | |
| if echo "$FILES" | grep -q "^templates/"; then | |
| LABELS="$LABELS templates" | |
| fi | |
| if echo "$FILES" | grep -qE "(README\.md|AGENTS\.md|CLAUDE\.md|ROADMAP\.md|CHANGELOG\.md|^docs/)"; then | |
| LABELS="$LABELS documentation" | |
| fi | |
| if echo "$FILES" | grep -q "^\.github/"; then | |
| LABELS="$LABELS ci" | |
| fi | |
| if [ -n "$LABELS" ]; then | |
| for label in $LABELS; do | |
| gh label create "$label" --force --color "ededed" 2>/dev/null || true | |
| gh pr edit ${{ github.event.pull_request.number }} --add-label "$label" | |
| done | |
| echo "Applied labels:$LABELS" | |
| else | |
| echo "No labels to apply" | |
| fi |