5252 required : false
5353 default : true
5454 lint :
55- description : " Optional flag to enable linting."
56- type : boolean
55+ description : |
56+ Whether to enable linting.
57+ Set to `null` or empty to disable.
58+ Accepts a JSON object for lint options. See [lint action](../actions/lint/README.md).
59+ type : string
5760 required : false
58- default : true
61+ default : " true"
5962 code-ql :
6063 description : " Code QL analysis language. See <https://github.com/github/codeql-action>."
6164 type : string
6770 required : false
6871 default : true
6972 test :
70- description : " Optional flag to enable test."
71- type : boolean
72- required : false
73- default : true
74- coverage :
75- description : " Specify code coverage reporter. Supported values: `codecov`."
73+ description : |
74+ Whether to enable testing.
75+ Set to `null` or empty to disable.
76+ Accepts a JSON object for test options. See [test action](../actions/test/README.md).
7677 type : string
7778 required : false
78- default : " codecov "
79+ default : " true "
7980 working-directory :
8081 description : " Working directory where the dependencies are installed."
8182 type : string
@@ -247,7 +248,7 @@ jobs:
247248
248249 lint :
249250 name : 👕 Lint
250- if : inputs.checks == true && inputs.lint != false
251+ if : inputs.checks == true && inputs.lint
251252 runs-on : ${{ inputs.runs-on && fromJson(inputs.runs-on) || 'ubuntu-latest' }}
252253 container :
253254 image : ${{ inputs.container != '' && inputs.container || null }}
@@ -277,6 +278,23 @@ jobs:
277278 if [ -f .gitignore ]; then grep -q "self-workflow" .gitignore || echo "self-workflow" >> .gitignore; else echo "self-workflow" >> .gitignore; fi
278279 if [ -f .dockerignore ]; then grep -q "self-workflow" .dockerignore || echo "self-workflow" >> .dockerignore; else echo "self-workflow" >> .dockerignore; fi
279280 # jscpd:ignore-end
281+ - id : preparel-lint-options
282+ uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
283+ env :
284+ LINT_INPUT : ${{ inputs.lint }}
285+ with :
286+ script : |
287+ const lintInput = process.env.LINT_INPUT.trim();
288+ if (lintInput && lintInput !== 'true') {
289+ try {
290+ const parsed = JSON.parse(lintInput);
291+ lintOptions = { ...lintOptions, ...parsed };
292+ } catch (error) {
293+ core.setFailed(`Failed to parse lint input as JSON: ${error.message}`);
294+ return;
295+ }
296+ }
297+
280298 - uses : ./self-workflow/actions/lint
281299 with :
282300 working-directory : ${{ inputs.working-directory }}
@@ -332,7 +350,7 @@ jobs:
332350
333351 test :
334352 name : 🧪 Test
335- if : inputs.checks == true && inputs.test == true
353+ if : inputs.checks == true && inputs.test
336354 runs-on : ${{ inputs.runs-on && fromJson(inputs.runs-on) || 'ubuntu-latest' }}
337355 container :
338356 image : ${{ inputs.container != '' && inputs.container || null }}
@@ -343,9 +361,9 @@ jobs:
343361 - build
344362 permissions :
345363 contents : read
364+ pull-requests : write
346365 # FIXME: This is a workaround for having workflow ref. See https://github.com/orgs/community/discussions/38659
347366 id-token : write
348- pull-requests : write
349367 steps :
350368 - uses : hoverkraft-tech/ci-github-common/actions/checkout@753288393de1f3d92f687a6761d236ca800f5306 # 0.28.1
351369 if : inputs.container == ''
@@ -370,9 +388,34 @@ jobs:
370388 if [ -f .gitignore ]; then grep -q "self-workflow" .gitignore || echo "self-workflow" >> .gitignore; else echo "self-workflow" >> .gitignore; fi
371389 if [ -f .dockerignore ]; then grep -q "self-workflow" .dockerignore || echo "self-workflow" >> .dockerignore; else echo "self-workflow" >> .dockerignore; fi
372390
391+ - id : prepare-test-options
392+ uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
393+ env :
394+ TEST_INPUT : ${{ inputs.test }}
395+ with :
396+ script : |
397+ const testInput = process.env.TEST_INPUT.trim();
398+ if (testInput && testInput !== 'true') {
399+ try {
400+ const parsed = JSON.parse(testInput);
401+ testOptions = { ...testOptions, ...parsed };
402+ } catch (error) {
403+ core.setFailed(`Failed to parse test input as JSON: ${error.message}`);
404+ return;
405+ }
406+ }
407+
408+ if (testOptions.coverage === undefined) {
409+ testOptions.coverage = 'github';
410+ }
411+ core.setOutput('coverage', testOptions.coverage );
412+
413+ core.setOutput('coverage-files', testOptions['coverage-files'] || '');
414+
373415 - uses : ./self-workflow/actions/test
374416 with :
375417 working-directory : ${{ inputs.working-directory }}
376418 container : ${{ inputs.container != '' }}
377- coverage : ${{ inputs.coverage }}
419+ coverage : ${{ steps.prepare-test-options.outputs.coverage }}
420+ coverage-files : ${{ steps.prepare-test-options.outputs['coverage-files'] }}
378421 github-token : ${{ github.token }}
0 commit comments