Skip to content

[SDK] Chore: Sets coverage thresholds #129

[SDK] Chore: Sets coverage thresholds

[SDK] Chore: Sets coverage thresholds #129

Workflow file for this run

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]}`);