66# or to provide custom queries or build logic.
77name : " CodeQL"
88
9+ permissions : {}
10+
911on :
1012 push :
1113 branches : [develop, master]
2426 name : Analyze
2527 runs-on : ${{ matrix.config.os }}
2628 permissions :
27- security-events : write
29+ security-events : write # Upload CodeQL SARIF results to code scanning.
2830 contents : read
29- actions : read
31+ actions : read # Allow CodeQL to inspect workflow and action metadata.
3032 strategy :
3133 fail-fast : false
3234 matrix :
@@ -71,22 +73,23 @@ jobs:
7173
7274 steps :
7375 - name : Harden Runner
74- uses : step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.14.1
76+ uses : step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.14.1
7577 with :
7678 egress-policy : audit
7779
7880 - name : Checkout repository
79- uses : actions/checkout@v6.0.2
81+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8082 continue-on-error : true # rsync code 24: harmless cleanup-phase race during VM setup
8183 with :
84+ persist-credentials : false
8285 # We must fetch at least the immediate parents so that if this is
8386 # a pull request then we can checkout the head.
8487 fetch-depth : 2
8588 submodules : recursive
8689
8790 - name : Settings vars for MSVC
8891 if : startsWith(matrix.config.name, 'Windows MSVC')
89- uses : ilammy/msvc-dev-cmd@v1
92+ uses : ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
9093 with :
9194 arch : ${{ matrix.config.arch }}
9295
97100
98101 # Initializes the CodeQL tools for scanning.
99102 - name : Initialize CodeQL
100- uses : github/codeql-action/init@v4
103+ uses : github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
101104 with :
102105 languages : ${{ matrix.language }}
103106 # If you wish to specify custom queries, you can do so here or in a config file.
@@ -118,7 +121,7 @@ jobs:
118121 # uses a compiled language
119122
120123 - name : Setup pip cache
121- uses : actions/cache@v5.0.0
124+ uses : actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
122125 with :
123126 path : |
124127 ~/.cache/pip
@@ -134,10 +137,16 @@ jobs:
134137 env :
135138 CC : ${{ matrix.config.cc }}
136139 CXX : ${{ matrix.config.cxx }}
140+ MESON_OPTS : ${{ matrix.config.meson_opts }}
137141 run : |
138142 pip install meson ninja
139143 $prefix = Join-Path $env:GITHUB_WORKSPACE 'install'
140- meson setup build --prefix "$prefix" -Dmandir=man -Dbindir=bin ${{ matrix.config.meson_opts }} --buildtype=release
144+ $mesonArgs = @('setup', 'build', '--prefix', $prefix, '-Dmandir=man', '-Dbindir=bin')
145+ if ($env:MESON_OPTS) {
146+ $mesonArgs += ($env:MESON_OPTS -split ' ')
147+ }
148+ $mesonArgs += '--buildtype=release'
149+ meson @mesonArgs
141150 meson install -C build
142151
143152 - name : Install Meson and Ninja and Build (Github runners - non-MSVC)
@@ -146,10 +155,17 @@ jobs:
146155 env :
147156 CC : ${{ matrix.config.cc }}
148157 CXX : ${{ matrix.config.cxx }}
158+ MESON_OPTS : ${{ matrix.config.meson_opts }}
149159 run : |
150160 pip install meson ninja
151- meson setup build --prefix "$GITHUB_WORKSPACE/install" -Dmandir=man -Dbindir=bin ${{ matrix.config.meson_opts }} --buildtype=release
161+ meson_args=(setup build --prefix "$GITHUB_WORKSPACE/install" -Dmandir=man -Dbindir=bin)
162+ if [[ -n "$MESON_OPTS" ]]; then
163+ read -r -a extra_meson_args <<< "$MESON_OPTS"
164+ meson_args+=("${extra_meson_args[@]}")
165+ fi
166+ meson_args+=(--buildtype=release)
167+ meson "${meson_args[@]}"
152168 meson install -C build
153169
154170 - name : Perform CodeQL Analysis
155- uses : github/codeql-action/analyze@v4
171+ uses : github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
0 commit comments