Skip to content

apply cookiecutter

apply cookiecutter #17

Workflow file for this run

name: pull_request label
on:
pull_request:
types:
- opened
- labeled
- unlabeled
- synchronize
jobs:
check-labels:
runs-on: ubuntu-latest
steps:
- name: pull_request label
run: |
echo "Checking for label on pull request..."
PR_DATA=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }})
LABEL_NAMES=$(echo "$PR_DATA" | jq -r '.labels[].name')
echo "Labels: $LABEL_NAMES"
if [ -z "$LABEL_NAMES" ]; then
echo "Error: No label found on this pull request. Please add a label."
exit 1
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}