Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Linked Issue

on:
pull_request:
types: [opened, edited]

env:
VALID_ISSUE_PREFIXES: "CNCT|DASH"

jobs:
linear:
name: Linear
runs-on: ubuntu-latest
steps:
- name: Check for linked issue
uses: actions/github-script@v7
with:
script: |
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});

const body = pr.data.body || '';
const issueRegex = new RegExp(`(${process.env.VALID_ISSUE_PREFIXES})-\\d+`, 'i');

if (!issueRegex.test(body)) {
core.setFailed(
`No valid issue reference found. PR body must contain an issue ID with one of these prefixes: ${process.env.VALID_ISSUE_PREFIXES}`
);
return;
}

const matches = body.match(issueRegex);
console.log(`Found issue reference: ${matches[0]}`);
26 changes: 0 additions & 26 deletions .github/workflows/linear.yml

This file was deleted.

Loading