kibana/.github/workflows/codeql.yml
Thomas Watson da89dde7ac
[codeql] Do not run GitHub CodeQL Action on forks (#150974)
It turned out that the CodeQL action also runs on forks which generate a
lot of noise in the form of security e-mails to the owners of those
forks.
2023-02-14 08:44:11 +01:00

49 lines
1.4 KiB
YAML

name: "CodeQL"
on:
schedule:
- cron: '27 21 * * *' # At 21:27 every day
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
if: github.repository == 'elastic/kibana' # Hack: Do not run on forks
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
branch: [ 'main', '7.17' ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ matrix.branch }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
# TODO: Possibly required to follow all call paths, however, when enabled, the step below runs out of memory.
# Possible workarounds: Apply for access to the GitHub beta where we can use beefier machines, or run it ourselves on Buildkite
# - name: yarn kbn bootstrap
# run: |
# mkdir ~/.npm-global
# npm config set prefix '~/.npm-global'
# export PATH=~/.npm-global/bin:$PATH
# yarn kbn bootstrap --no-validate --no-vscode
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
# env:
# NODE_OPTIONS: "--max-old-space-size=6144"
with:
category: "/language:${{matrix.language}}"