Skip to content

Commit c69effe

Browse files
committed
feat: add option to disallow code generation from strings
1 parent 869d838 commit c69effe

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

.github/workflows/plugins-ci.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ on:
3333
required: false
3434
default: '["20", "22"]'
3535
type: string
36+
check-disallow-code-generation-from-strings:
37+
description: 'Enables --disallow-code-generation-from-strings flag for Node.js'
38+
required: false
39+
default: false
40+
type: boolean
3641

3742
jobs:
3843
dependency-review:
@@ -110,12 +115,23 @@ jobs:
110115
matrix:
111116
node-version: ${{ fromJson(inputs.node-versions) }}
112117
os: [macos-latest, ubuntu-latest, windows-latest]
118+
disallow-code-generation-from-strings: ${{ inputs.check-disallow-code-generation-from-strings == true && ['true', 'false'] || ['false'] }}
113119
exclude:
114120
- os: macos-latest
115121
node-version: 14
116122
- os: macos-latest
117123
node-version: 16
118124
steps:
125+
- name: Set node flags
126+
id: node-flags
127+
shell: bash
128+
run: |
129+
if [ "${{ matrix.disallow-code-generation-from-strings }}" = "true" ]; then
130+
echo "flags=--disallow-code-generation-from-strings" >> $GITHUB_OUTPUT
131+
else
132+
echo "flags=" >> $GITHUB_OUTPUT
133+
fi
134+
119135
- name: Check out repo
120136
uses: actions/checkout@v4
121137
with:
@@ -130,7 +146,7 @@ jobs:
130146
run: npm i --ignore-scripts
131147

132148
- name: Run tests
133-
run: npm test
149+
run: NODE_OPTIONS="${{ steps.node-flags.outputs.flags }}" npm test
134150

135151
fastify-dependency-integration:
136152
name: Test Fastify Integration

0 commit comments

Comments
 (0)