diff --git a/.github/workflows/require-linear-issue.yml b/.github/workflows/require-linear-issue.yml new file mode 100644 index 0000000..b964e92 --- /dev/null +++ b/.github/workflows/require-linear-issue.yml @@ -0,0 +1,25 @@ +name: Require Linear Issue in Pull Request + +on: + workflow_dispatch: + pull_request: + branches: + - main + types: [opened, reopened] + +jobs: + require-linear-issue: + runs-on: ubuntu-latest + steps: + - name: Find the Linear Issue + id: find-issue + uses: ctriolo/action-find-linear-issue@v0.60 + with: + linear-api-key: ${{ secrets.LINEAR_API_KEY }} + + - name: Require Linear Issue + run: | + if [ -z "${{ steps.find-issue.outputs.linear-issue-identifier }}" ]; then + echo "Please add a Linear ID to the title of the Pull Request. Using the Linear branch name would have done this automatically." + exit 1 + fi \ No newline at end of file