## Problem solved https://linear.app/thirdweb/issue/INSIGHT-480/improvements-required-for-insight-playground Updated the authentication method in the Insight API documentation to use the `x-client-id` header instead of embedding the client ID in the URL path. <!-- start pr-codex --> --- ## PR-Codex overview This PR updates the GitHub workflow and documentation related to the `insight` feature. It enhances the valid issue prefixes and provides clearer instructions for authentication in the API usage. ### Detailed summary - Updated `VALID_ISSUE_PREFIXES` to include `INSIGHT`. - Improved documentation in `apps/portal/src/app/insight/get-started/page.mdx`: - Corrected "clientId" to "client ID". - Added a note about using the `x-client-id` header for authentication. - Modified the API fetch request to include headers for `client ID`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
39 lines
1.3 KiB
YAML
39 lines
1.3 KiB
YAML
name: Linked Issue
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, edited]
|
|
|
|
env:
|
|
VALID_ISSUE_PREFIXES: "CNCT|DASH|PROT|INSIGHT"
|
|
|
|
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 branchName = pr.data.head.ref;
|
|
const issueRegex = new RegExp(`(${process.env.VALID_ISSUE_PREFIXES})-\\d+`, 'i');
|
|
const branchIssueRegex = new RegExp(`(${process.env.VALID_ISSUE_PREFIXES.toLowerCase()})-\\d+`, 'i');
|
|
|
|
if (!issueRegex.test(body) && !branchIssueRegex.test(branchName)) {
|
|
core.setFailed(
|
|
`No valid issue reference found. PR body or branch name must contain an issue ID with one of these prefixes: ${process.env.VALID_ISSUE_PREFIXES}`
|
|
);
|
|
return;
|
|
}
|
|
|
|
const matches = body.match(issueRegex) || branchName.match(branchIssueRegex);
|
|
console.log(`Found issue reference: ${matches[0]}`);
|