diff --git a/.github/workflows/pr-title-check.yml b/.github/workflows/pr-title-check.yml index b3fbbd3..5dae45a 100644 --- a/.github/workflows/pr-title-check.yml +++ b/.github/workflows/pr-title-check.yml @@ -10,9 +10,13 @@ jobs: steps: - name: Check for Linear issue ID env: - PR_TITLE: ${{ github.event.pull_request.title }} - PR_AUTHOR_TYPE: ${{ github.event.pull_request.user.type }} + GH_TOKEN: ${{ github.token }} + PR_NUMBER: ${{ github.event.pull_request.number }} + REPO: ${{ github.repository }} run: | + PR_DATA=$(gh api "repos/$REPO/pulls/$PR_NUMBER" --jq '{title: .title, author_type: .user.type}') + PR_TITLE=$(echo "$PR_DATA" | jq -r '.title') + PR_AUTHOR_TYPE=$(echo "$PR_DATA" | jq -r '.author_type') if [ "$PR_AUTHOR_TYPE" = "Bot" ]; then echo "Bot PR — skipping check." elif echo "$PR_TITLE" | grep -qPi '^[A-Z]+[-\s]\d+\b'; then