-
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
101 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,14 @@ | ||
--- | ||
name: Test action for validate-inputs | ||
description: | | ||
Uses validate-inputs action for checking inputs and throws | ||
an error when any of them is invalid. | ||
inputs: | ||
number: | ||
description: Should be a number | ||
required: true | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Runs validate-inputs | ||
uses: ./validate-inputs |
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,32 @@ | ||
--- | ||
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 action with invalid input | ||
uses: ./.github/tests/validate-inputs | ||
with: | ||
number: 'aa' | ||
|
||
- name: Call action with valid input | ||
uses: ./.github/tests/validate-inputs | ||
with: | ||
number: '123' |
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,7 @@ | ||
--- | ||
name: Validate inputs | ||
description: | | ||
This action uses regular expressions to validate inputs | ||
runs: | ||
using: 'node20' | ||
main: 'dist/index.js' |
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,17 @@ | ||
/******/ (() => { // webpackBootstrap | ||
/******/ /* webpack/runtime/compat */ | ||
/******/ | ||
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/"; | ||
/******/ | ||
/************************************************************************/ | ||
var __webpack_exports__ = {}; | ||
try { | ||
console.log(process.env); | ||
|
||
} catch (error) { | ||
core.setFailed(error.message); | ||
} | ||
|
||
module.exports = __webpack_exports__; | ||
/******/ })() | ||
; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,12 @@ | ||
{ | ||
"name": "validate-inputs", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC" | ||
} |
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,6 @@ | ||
try { | ||
console.log(process.env); | ||
|
||
} catch (error) { | ||
core.setFailed(error.message); | ||
} |