diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 72c937d9c1..dbc3590d4a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -10,13 +10,27 @@ on: description: 'Optional suffix to invalidate the build cache' required: false pull_request_target: - + paths: + - '**.cpp' + - '**.h' + - '**.hpp' + - '**.c' + - 'CMakeLists.txt' + - 'CMakePresets.json' + - 'vcpkg.json' + - 'vcpkg-configuration.json' + - '.gitmodules' + - 'extern/**' permissions: contents: write pull-requests: write jobs: build: + if: > + github.event_name != 'pull_request_target' || + github.event.pull_request.draft == false || + contains(github.event.pull_request.labels.*.name, 'force-build') name: build plugin and addons runs-on: windows-latest outputs: @@ -36,7 +50,7 @@ jobs: uses: actions/cache@v3 with: path: build/ALL - key: ${{ runner.os }}-build-${{ inputs.cache-key-suffix || 'default' }}-${{ hashFiles('CMakePresets.json', 'vcpkg.json', 'vcpkg-configuration.json', '**/CMakeLists.txt', '**/*.cpp', '**/*.c', '**/*.h', '**/*.hpp') }} + key: ${{ runner.os }}-build-${{ inputs.cache-key-suffix || 'default' }}-${{ hashFiles('.gitmodules', 'extern/**', 'CMakePresets.json', 'vcpkg.json', 'vcpkg-configuration.json', '**/CMakeLists.txt', '**/*.cpp', '**/*.c', '**/*.h', '**/*.hpp') }} restore-keys: | ${{ runner.os }}-build-