Skip to content

Commit f20e021

Browse files
committed
Add support for adding setup-dotnet steps to sync.sh
1 parent ba454b8 commit f20e021

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

.github/workflows/__local-bundle.yml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pr-checks/checks/local-bundle.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ description: "Tests using a CodeQL bundle from a local file rather than a URL"
33
versions: ["linked"]
44
installGo: true
55
installPython: true
6+
installDotNet: true
67
steps:
78
- name: Fetch latest CodeQL bundle
89
run: |

pr-checks/sync.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,25 @@ def writeHeader(checkStream):
204204
}
205205
})
206206

207+
installDotNet = is_truthy(checkSpecification.get('installDotNet', ''))
208+
209+
if installDotNet:
210+
baseDotNetVersionExpr = '9.x'
211+
workflowInputs['dotnet-version'] = {
212+
'type': 'string',
213+
'description': 'The version of .NET to install',
214+
'required': False,
215+
'default': baseDotNetVersionExpr,
216+
}
217+
218+
steps.append({
219+
'name': 'Install .NET',
220+
'uses': 'actions/setup-dotnet@v5',
221+
'with': {
222+
'dotnet-version': '${{ inputs.dotnet-version || \'' + baseDotNetVersionExpr + '\' }}'
223+
}
224+
})
225+
207226
# If container initialisation steps are present in the check specification,
208227
# make sure to execute them first.
209228
if 'container' in checkSpecification and 'container-init-steps' in checkSpecification:

0 commit comments

Comments
 (0)