Skip to content

Commit 7760245

Browse files
committed
.sync/workflows/codeql-platform: Update irrelevant plugin removal dir
Updates the directory used for irrelevant plugin removal in this workflow to match codeql.yml which using the pytool directory rather than the directory the CodeQL plugin is found in. This is important because the CodeQL plugin moved from .pytool to BaseTools in Mu release 202311 so the plugin dir needs to be fixed rather than relative to the CodeQL plugin location. Signed-off-by: Michael Kubacki <[email protected]>
1 parent 170b872 commit 7760245

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

.sync/workflows/leaf/codeql-platform.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,32 @@ jobs:
376376
working-directory: "Z:"
377377
run: stuart_update -c ${{ matrix.build_file }} -t DEBUG -a ${{ matrix.archs }} TOOL_CHAIN_TAG=${{ matrix.tool_chain_tag }} --codeql
378378

379+
- name: Find pytool Plugin Directory
380+
id: find_pytool_dir
381+
shell: python
382+
run: |
383+
import os
384+
import sys
385+
from pathlib import Path
386+
387+
# Find the plugin directory that contains the Compiler plugin
388+
plugin_dir = list(Path(os.environ['GITHUB_WORKSPACE']).rglob('.pytool/Plugin/CompilerPlugin'))
389+
390+
# This should only be found once
391+
if len(plugin_dir) == 1:
392+
# If the directory is found get the parent Plugin directory
393+
plugin_dir = str(plugin_dir[0].parent)
394+
395+
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
396+
print(f'pytool_plugin_dir={plugin_dir}', file=fh)
397+
else:
398+
print("::error title=Workspace Error!::Failed to find Mu Basecore .pytool/Plugin directory!")
399+
sys.exit(1)
400+
379401
- name: Remove CI Plugins Irrelevant to CodeQL
380402
shell: python
381403
env:
382-
CODEQL_PLUGIN_DIR: ${{ steps.find_dir.outputs.codeql_plugin_dir }}
404+
PYTOOL_PLUGIN_DIR: ${{ steps.find_pytool_dir.outputs.pytool_plugin_dir }}
383405
run: |
384406
import os
385407
import shutil
@@ -388,7 +410,7 @@ jobs:
388410
# Only these two plugins are needed for CodeQL
389411
plugins_to_keep = ['CodeQL', 'CompilerPlugin']
390412
391-
plugin_dir = Path(os.environ['CODEQL_PLUGIN_DIR']).parent.absolute()
413+
plugin_dir = Path(os.environ['PYTOOL_PLUGIN_DIR']).absolute()
392414
if plugin_dir.is_dir():
393415
for dir in plugin_dir.iterdir():
394416
if str(dir.stem) not in plugins_to_keep:

0 commit comments

Comments
 (0)