From 1ee4e4791e8d6ae84c9207186c02278ddd9cb90e Mon Sep 17 00:00:00 2001 From: Ray R Date: Wed, 8 Jan 2025 11:54:27 -0800 Subject: [PATCH] 381: update the linked issue workflow to reuse the compose reusable workflow. --- .github/workflows/link_issue.yml | 40 +++----------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/.github/workflows/link_issue.yml b/.github/workflows/link_issue.yml index 8e7d894f..2400db17 100644 --- a/.github/workflows/link_issue.yml +++ b/.github/workflows/link_issue.yml @@ -6,40 +6,6 @@ on: jobs: check-linked-issue: - if: github.event.pull_request.user.login != 'dependabot[bot]' - runs-on: ubuntu-latest - steps: - - name: Verify Linked Issue - uses: actions/github-script@v7 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const { pull_request } = context.payload; - const bodyText = pull_request.body || ''; - const issuePattern = /(?:close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved)\s+#(\d+)/i; - const match = bodyText.match(issuePattern); - - if (!match) { - core.setFailed('No linked issue found in the pull request description.'); - return; - } - - const issueNumber = parseInt(match[1], 10); - const { owner, repo } = context.repo; - - try { - const issue = await github.rest.issues.get({ - owner, - repo, - issue_number: issueNumber - }); - const minLength = 30; // Minimum description length - - if (!issue.data.body || issue.data.body.trim().length < minLength) { - core.setFailed(`Linked issue #${issueNumber} does not have a sufficient description (at least ${minLength} characters required).`); - } else { - console.log(`Linked issue #${issueNumber} has a sufficient description.`); - } - } catch (error) { - core.setFailed(`Issue #${issueNumber} not found or inaccessible.`); - } + uses: wildlife-dynamics/compose/.github/workflows/check-linked-issue.yaml@main + with: + pr_body: ${{ github.event.pull_request.body }}