From b5d1d89d65a229e7889211c252b0ce45c09237c0 Mon Sep 17 00:00:00 2001 From: luke-ht Date: Mon, 27 Apr 2026 11:03:46 -0400 Subject: [PATCH] feat: add reusable pr-linear-check workflow Reusable workflow_call workflow that validates PR body contains a valid Linear ticket URL. Skips bot actors (dependabot, renovate, github-actions). Accepts linear_org input (default: twenty). DO-360 --- .github/workflows/pr-linear-check.yml | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/pr-linear-check.yml diff --git a/.github/workflows/pr-linear-check.yml b/.github/workflows/pr-linear-check.yml new file mode 100644 index 0000000..2c8a181 --- /dev/null +++ b/.github/workflows/pr-linear-check.yml @@ -0,0 +1,34 @@ +name: PR Linear Ticket Check + +on: + workflow_call: + inputs: + linear_org: + description: Linear workspace slug (part of the URL) + type: string + default: twenty + +jobs: + check-linear-ticket: + runs-on: ubuntu-latest + steps: + - name: Check Linear ticket URL (skip bots) + env: + PR_BODY: ${{ github.event.pull_request.body }} + LINEAR_ORG: ${{ inputs.linear_org }} + ACTOR: ${{ github.actor }} + run: | + if [[ "$ACTOR" == "dependabot[bot]" || "$ACTOR" == "renovate[bot]" || "$ACTOR" == "github-actions[bot]" ]]; then + echo "Bot actor ($ACTOR) — skipping Linear ticket check" + exit 0 + fi + if echo "$PR_BODY" | grep -qE "https://linear\.app/${LINEAR_ORG}/issue/[A-Z]+-[0-9]+"; then + echo "✅ Linear ticket URL found" + else + echo "❌ PR body must contain a Linear ticket URL" + echo "" + echo "Expected format: https://linear.app/${LINEAR_ORG}/issue/DO-123/ticket-slug" + echo "" + echo "Add a '## Linear Ticket' section to your PR body with the ticket URL." + exit 1 + fi