Skip to content

feat(check-jira-reference): extract Jira check into composite action#11

Open
GoogilyBoogily wants to merge 1 commit into
feat/ts-infrafrom
feat/check-jira-action
Open

feat(check-jira-reference): extract Jira check into composite action#11
GoogilyBoogily wants to merge 1 commit into
feat/ts-infrafrom
feat/check-jira-action

Conversation

@GoogilyBoogily
Copy link
Copy Markdown
Contributor

Summary

Eliminates a DRY violation: the Jira ticket body check was implemented identically in two places (pr-title-jira-validation.yml inline grep, previously also duplicated). Extracts it into a single composite action backed by a TypeScript script.

Also fixes a latent bug: the jira-url-pattern input on pr-title-jira-validation.yml was defined but the job was using a hardcoded pattern instead. Now the input is correctly threaded through.

Changes:

  • src/check-jira-reference.ts: regex check against PR_BODY env var, core.setFailed with formatted error
  • actions/check-jira-reference/action.yml: composite action wrapping the script
  • pr-title-jira-validation.yml: replace inline grep with composite action call

Test plan

  • Open a PR without a Jira ticket link in the body — jira-reference-check job fails with formatted error
  • Open a PR with a valid Jira URL — job passes
  • Confirm custom jira-url-pattern input is respected

Copilot AI review requested due to automatic review settings May 29, 2026 15:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extracts the Jira ticket body validation from the reusable PR title/Jira workflow into a dedicated composite action backed by a TypeScript script, while threading the existing jira-url-pattern input through to the check.

Changes:

  • Adds src/check-jira-reference.ts and generated dist/check-jira-reference.js.
  • Adds actions/check-jira-reference as a reusable composite action.
  • Replaces the inline Jira body grep in pr-title-jira-validation.yml with the new action.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/check-jira-reference.ts Implements the Jira reference check using PR_BODY and JIRA_PATTERN environment variables.
dist/check-jira-reference.js Committed build output for the new TypeScript script.
actions/check-jira-reference/action.yml Defines the composite action wrapper around the compiled script.
.github/workflows/pr-title-jira-validation.yml Calls the new composite action and passes through the configured Jira URL pattern.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +16 to +21
- name: "Check for Jira ticket reference"
run: node '${{ github.action_path }}/../../dist/check-jira-reference.js'
shell: bash
env:
PR_BODY: ${{ inputs.pr-body }}
JIRA_PATTERN: ${{ inputs.jira-url-pattern }}
Comment thread src/check-jira-reference.ts Outdated
import * as core from '@actions/core';
import { getRequiredEnv } from './utils';

const prBody = getRequiredEnv('PR_BODY');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants