From 4541a2f393e3335abe584198e3f7eafff7e0b46c Mon Sep 17 00:00:00 2001 From: Arjun Naha Date: Mon, 7 Oct 2024 19:26:23 +0100 Subject: [PATCH] CI - Enforce Linear issue on pull requests --- .github/workflows/require-linear-issue.yml | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/require-linear-issue.yml 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