Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A0-3312: Add match-against-regexp action #22

Merged
13 commits merged into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/test-match-against-regexp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: Test match-against-regexp action

on:
pull_request:
branches:
- main
push:
branches:
- main

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
main:
name: Test match-against-regexp action
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Check with valid values
uses: ./match-against-regexp
with:
values: |-
123
abd123
lichi
regexps: |-
[0-9]+
[a-z0-9]+
apple|banana|lichi

- name: Check with invalid values
id: should-fail
continue-on-error: true
uses: ./match-against-regexp
with:
values: |-
aaa
abd123
tomato
regexps: |-
[0-9]+
[a-z0-9]+
apple|banana|lichi

- name: Check failure
shell: bash
run: |
if [[ "${{ steps.should-fail.outcome }}" == "success" ]]; then
echo "!!! Failure test failed. Something fishy is going on here"
exit 1
fi
13 changes: 13 additions & 0 deletions match-against-regexp/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Match against regexp
description: This action matches one-line values against regular expression
inputs:
values:
description: Values to be checked against regular expression. One per line
required: true
regexps:
description: Regular expressions to check against. One per line
required: true
runs:
using: 'node20'
main: 'dist/index.js'
Loading