This action matches a string against a regex pattern and outputs the first match
Required The regex pattern to test with (e.g. "JIR-[0-9]+")
The regex flags (e.g. "gim")
Required The string to test against (e.g. "My jira ticket number is JIR-12345")
First regex match (e.g. "JIR-12345")
- name: Find JIRA ticket references
id: jira
uses: AsasInnab/regex-action@v1
with:
regex_pattern: 'JIR-[0-9]+'
regex_flags: 'gim'
search_string: ' My jira ticket number is JIR-12345'
- name: Echo JIRA reference
run: echo "My JIRA ticket number is ${{ steps.jira.outputs.first_match }}"