Skip to content

test added file in not ignored path for testing #17449

test added file in not ignored path for testing

test added file in not ignored path for testing #17449

name: "CodeQL"
on:
push:
branches: [develop, master, testing_CodeQL_passed_if_change_in_ignored_paths]
paths-ignore:
- 'e2e/resources/**'
- 'docs/**'
pull_request:
# The branches below must be a subset of the branches above
branches: [develop, testing_CodeQL_passed_if_change_in_ignored_paths]
paths-ignore:
- 'e2e/resources/**'
- 'docs/**'
schedule:
- cron: '0 5 * * 0'
jobs:
check-paths:
runs-on: ubuntu-latest
outputs:
skip_codeql: ${{ steps.check.outputs.skip_codeql }}
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Check for ignored paths
id: check
run: |
changed_files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }})
echo "Changed files: $changed_files"
if echo "$changed_files" | grep -qvE '^(e2e/resources/|docs/)'; then
echo "CodeQL will run"
echo "::set-output name=skip_codeql::true"
else
echo "CodeQL will be skipped"
echo "::set-output name=skip_codeql::false"
fi
analyze:
needs: check-paths
if: needs.check-paths.outputs.skip_codeql == 'false'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
# Override language selection by uncommenting this and choosing your languages
with:
languages: javascript
config-file: ./.github/codeql/codeql-config.yml
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1