[Dashboard] Feature: Modules UI changes #34
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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]}`); |