Skip to content

Commit daef1c0

Browse files
committed
don't run codeql on docs changes
1 parent a7274fa commit daef1c0

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,33 @@ permissions:
2121
contents: read
2222

2323
jobs:
24+
checks:
25+
name: Checks and variables
26+
runs-on: ubuntu-22.04
27+
outputs:
28+
docs_only: ${{ steps.docs.outputs.docs_only == 'true' }}
29+
steps:
30+
- name: Checkout Repository
31+
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
32+
with:
33+
fetch-depth: 0
34+
35+
- name: Filter only docs changes
36+
id: docs
37+
run: |
38+
files=$(git diff --name-only HEAD^ | egrep -v "^docs/")
39+
if [ -z "$files" ]; then
40+
echo "docs_only=true" >> $GITHUB_OUTPUT
41+
else
42+
echo "docs_only=false" >> $GITHUB_OUTPUT
43+
fi
44+
echo $files
45+
cat $GITHUB_OUTPUT
46+
shell: bash --noprofile --norc -o pipefail {0}
47+
2448
analyze:
49+
if: ${{ needs.checks.outputs.docs_only != 'true' }}
50+
needs: [checks]
2551
permissions:
2652
actions: read # for github/codeql-action/init to get workflow details
2753
contents: read # for actions/checkout to fetch code

0 commit comments

Comments
 (0)