From 24bb2a1f6018db263d8ca3843a8f4ed07737348f Mon Sep 17 00:00:00 2001 From: "Project Mu UEFI Bot [bot]" <45776386+uefibot@users.noreply.github.com> Date: Thu, 25 Jan 2024 14:40:42 -0500 Subject: [PATCH] Repo File Sync: synced file(s) with microsoft/mu_devops (#234) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit synced local file(s) with [microsoft/mu_devops](https://github.com/microsoft/mu_devops). 🤖: View the [Repo File Sync Configuration File](https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml) to see how files are synced. --- This PR was created automatically by the [repo-file-sync-action](https://github.com/BetaHuhn/repo-file-sync-action) workflow run [#7652167966](https://github.com/microsoft/mu_devops/actions/runs/7652167966) Signed-off-by: Project Mu UEFI Bot --- .github/workflows/codeql.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index fd6c928fe9..70e2660a31 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -321,10 +321,32 @@ jobs: if: steps.codeqlcli_cache.outputs.cache-hit != 'true' run: stuart_update -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.archs }} TOOL_CHAIN_TAG=${{ matrix.tool_chain_tag }} --codeql + - name: Find pytool Plugin Directory + id: find_pytool_dir + shell: python + run: | + import os + import sys + from pathlib import Path + + # Find the plugin directory that contains the Compiler plugin + plugin_dir = list(Path(os.environ['GITHUB_WORKSPACE']).rglob('.pytool/Plugin/CompilerPlugin')) + + # This should only be found once + if len(plugin_dir) == 1: + # If the directory is found get the parent Plugin directory + plugin_dir = str(plugin_dir[0].parent) + + with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: + print(f'pytool_plugin_dir={plugin_dir}', file=fh) + else: + print("::error title=Workspace Error!::Failed to find Mu Basecore .pytool/Plugin directory!") + sys.exit(1) + - name: Remove CI Plugins Irrelevant to CodeQL shell: python env: - CODEQL_PLUGIN_DIR: ${{ steps.find_dir.outputs.codeql_plugin_dir }} + PYTOOL_PLUGIN_DIR: ${{ steps.find_pytool_dir.outputs.pytool_plugin_dir }} run: | import os import shutil @@ -333,7 +355,7 @@ jobs: # Only these two plugins are needed for CodeQL plugins_to_keep = ['CodeQL', 'CompilerPlugin'] - plugin_dir = Path(os.environ['CODEQL_PLUGIN_DIR']).parent.absolute() + plugin_dir = Path(os.environ['PYTOOL_PLUGIN_DIR']).absolute() if plugin_dir.is_dir(): for dir in plugin_dir.iterdir(): if str(dir.stem) not in plugins_to_keep: