50 lines
1.6 KiB
YAML
50 lines
1.6 KiB
YAML
name: CodeQL analysis
|
|
|
|
# **What it does**: This runs CodeQL on our repository.
|
|
# **Why we have it**: Security scanning.
|
|
# **Who does it impact**: Docs engineering.
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- '**/*.js'
|
|
- '.github/workflows/codeql.yml'
|
|
# This is so that when CodeQL runs on a pull request, it can compare
|
|
# against the state of the base branch.
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
actions: read
|
|
contents: read
|
|
security-events: write
|
|
|
|
# This allows a subsequently queued workflow run to interrupt previous runs
|
|
concurrency:
|
|
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
|
|
- uses: github/codeql-action/init@407ffafae6a767df3e0230c3df91b6443ae8df75 # v2.22.8
|
|
with:
|
|
languages: javascript # comma separated list of values from {go, python, javascript, java, cpp, csharp, ruby}
|
|
config: |
|
|
paths-ignore:
|
|
- 'src/open-source/scripts/add-pr-links.js'
|
|
- uses: github/codeql-action/analyze@407ffafae6a767df3e0230c3df91b6443ae8df75 # v2.22.8
|
|
continue-on-error: true
|
|
|
|
- uses: ./.github/actions/slack-alert
|
|
if: ${{ failure() && github.event_name != 'pull_request' }}
|
|
with:
|
|
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
|
|
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
|