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,25 @@ 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+
289+ let lintOptions = {};
290+ if (lintInput && lintInput !== 'true') {
291+ try {
292+ const parsed = JSON.parse(lintInput);
293+ lintOptions = { ...lintOptions, ...parsed };
294+ } catch (error) {
295+ core.setFailed(`Failed to parse lint input as JSON: ${error.message}`);
296+ return;
297+ }
298+ }
299+
280300 - uses : ./self-workflow/actions/lint
281301 with :
282302 working-directory : ${{ inputs.working-directory }}
@@ -332,7 +352,7 @@ jobs:
332352
333353 test :
334354 name : 🧪 Test
335- if : inputs.checks == true && inputs.test == true
355+ if : inputs.checks == true && inputs.test
336356 runs-on : ${{ inputs.runs-on && fromJson(inputs.runs-on) || 'ubuntu-latest' }}
337357 container :
338358 image : ${{ inputs.container != '' && inputs.container || null }}
@@ -343,9 +363,9 @@ jobs:
343363 - build
344364 permissions :
345365 contents : read
366+ pull-requests : write
346367 # FIXME: This is a workaround for having workflow ref. See https://github.com/orgs/community/discussions/38659
347368 id-token : write
348- pull-requests : write
349369 steps :
350370 - uses : hoverkraft-tech/ci-github-common/actions/checkout@753288393de1f3d92f687a6761d236ca800f5306 # 0.28.1
351371 if : inputs.container == ''
@@ -370,9 +390,36 @@ jobs:
370390 if [ -f .gitignore ]; then grep -q "self-workflow" .gitignore || echo "self-workflow" >> .gitignore; else echo "self-workflow" >> .gitignore; fi
371391 if [ -f .dockerignore ]; then grep -q "self-workflow" .dockerignore || echo "self-workflow" >> .dockerignore; else echo "self-workflow" >> .dockerignore; fi
372392
393+ - id : prepare-test-options
394+ uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
395+ env :
396+ TEST_INPUT : ${{ inputs.test }}
397+ with :
398+ script : |
399+ const testInput = process.env.TEST_INPUT.trim();
400+
401+ let testOptions = {};
402+ if (testInput && testInput !== 'true') {
403+ try {
404+ const parsed = JSON.parse(testInput);
405+ testOptions = { ...testOptions, ...parsed };
406+ } catch (error) {
407+ core.setFailed(`Failed to parse test input as JSON: ${error.message}`);
408+ return;
409+ }
410+ }
411+
412+ if (testOptions.coverage === undefined) {
413+ testOptions.coverage = 'github';
414+ }
415+ core.setOutput('coverage', testOptions.coverage );
416+
417+ core.setOutput('coverage-files', testOptions['coverage-files'] || '');
418+
373419 - uses : ./self-workflow/actions/test
374420 with :
375421 working-directory : ${{ inputs.working-directory }}
376422 container : ${{ inputs.container != '' }}
377- coverage : ${{ inputs.coverage }}
423+ coverage : ${{ steps.prepare-test-options.outputs.coverage }}
424+ coverage-files : ${{ steps.prepare-test-options.outputs['coverage-files'] }}
378425 github-token : ${{ github.token }}
0 commit comments