diff --git a/README.md b/README.md index 17b34c5..f299ba5 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ steps: uses: w3f/parse-milestone-delivery-action@master with: path: + strict: 'false' # optional, default is true - name: Echo outputs run: echo ${{ steps.grant_parser.outputs.team_name }} ``` diff --git a/action.yml b/action.yml index 280ae5a..f7d1865 100644 --- a/action.yml +++ b/action.yml @@ -5,6 +5,10 @@ inputs: path: description: 'File path' required: true + strict: + description: 'Strict mode: fails instead of warning' + required: false + default: 'true' outputs: application_document: description: 'Link to application PR' diff --git a/dist/index.js b/dist/index.js index 2ae69c7..cfa77a9 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2825,6 +2825,7 @@ const { promises: fs } = __nccwpck_require__(147) const main = async () => { const path = core.getInput('path') + const strict = core.getInput('strict') const content = await fs.readFile(path, 'utf8') const regexList = [ @@ -2879,7 +2880,11 @@ const main = async () => { if (errors.length > 0) { const error_string = `Match not found for: ${errors.join(', ')}` - core.setFailed(error_string) + if (strict !== 'true') { + core.warning(error_string) + } else { + core.setFailed(error_string) + } } } diff --git a/index.js b/index.js index 1adfa9e..4945d5e 100644 --- a/index.js +++ b/index.js @@ -5,6 +5,7 @@ const { promises: fs } = require('fs') const main = async () => { const path = core.getInput('path') + const strict = core.getInput('strict') const content = await fs.readFile(path, 'utf8') const regexList = [ @@ -59,7 +60,11 @@ const main = async () => { if (errors.length > 0) { const error_string = `Match not found for: ${errors.join(', ')}` - core.setFailed(error_string) + if (strict !== 'true') { + core.warning(error_string) + } else { + core.setFailed(error_string) + } } }