-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
30,582 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
name: Test validate-inputs action sub-workflow | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
number: | ||
description: A number | ||
required: true | ||
type: string | ||
alphanumeric-string: | ||
description: An alphanumeric string | ||
required: true | ||
type: string | ||
fruit: | ||
description: A fruit | ||
required: true | ||
type: string | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
main: | ||
name: Test validate-inputs action | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Validate inputs | ||
uses: ./validate-inputs | ||
with: | ||
names: |- | ||
number | ||
alphanumeric-string | ||
fruit | ||
regexps: |- | ||
[0-9]+ | ||
[a-z0-9]+ | ||
apple|banana|lichi |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
name: Test validate-inputs action | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
main: | ||
name: Test validate-inputs action | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Call sub-workflow with valid inputs | ||
uses: ./.github/workflows/_test-validate-inputs.yml | ||
with: | ||
number: 44 | ||
alphanumeric: abc123 | ||
fruit: lichi | ||
|
||
- name: Call sub-workflow with invalid inputs | ||
uses: ./.github/workflows/_test-validate-inputs.yml | ||
id: should-fail | ||
continue-on-error: true | ||
with: | ||
number: a | ||
alphanumeric: 34-a | ||
fruit: lemon | ||
|
||
- 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 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
name: Validate inputs | ||
description: This action validates inputs | ||
inputs: | ||
names: | ||
description: Names of inputs 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' |
Oops, something went wrong.