From a0049dad8e534772e9f3c97ce29c03de312ce858 Mon Sep 17 00:00:00 2001 From: Axel Gembe Date: Fri, 20 Oct 2023 14:02:06 +0700 Subject: [PATCH] tests: add env var IS_STEP_DEBUG to conditionally run debug prints Currently we just uncomment debug prints, but GitHub actions actually has the option to debug the runs, which sets a secret called `secrets.ACTIONS_STEP_DEBUG`. We can not directly access this in the jobs so we need to turn it into an envirionment variable. This way we can add an `if` condition to debug steps to skip them when we're not debugging the run: `if: ${{ env.IS_STEP_DEBUG == 'true' }}` Signed-off-by: Axel Gembe --- .github/workflows/windows-build-test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/windows-build-test.yml b/.github/workflows/windows-build-test.yml index e9636a8b23eb..cb6e7856fe22 100644 --- a/.github/workflows/windows-build-test.yml +++ b/.github/workflows/windows-build-test.yml @@ -22,6 +22,7 @@ on: env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Debug + IS_STEP_DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG }} jobs: build_windows: @@ -41,6 +42,7 @@ jobs: - name: debug - git status run: git status + if: ${{ env.IS_STEP_DEBUG == 'true' }} #https://stackoverflow.com/a/60883893 # "C:\Program Files\Git\bin\git.exe" -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +90acd8f20e6d0c14b83241cc7dcd17df27d5a95b:refs/remotes/origin/andrew_workflows-7 @@ -159,6 +161,7 @@ jobs: - name: debug - print log run: cat "${{github.workspace}}\InnoSetup-Install.log" + if: ${{ env.IS_STEP_DEBUG == 'true' }} - name: Check InstallLocation Registry Value run: |