-
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (63 loc) · 2.38 KB
/
Copy pathcodeql.yml
File metadata and controls
72 lines (63 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: CodeQL
# Single in-repo CodeQL source (advanced setup). GitHub default setup
# (Actions path dynamic/github-code-scanning/codeql, shown as
# "Code Quality: PR #N") must stay disabled — see docs/ci.md.
#
# Job name is "CodeQL" so the develop ruleset context of the same name
# still reports on release back-merges when the scan itself is skipped.
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
schedule:
- cron: '0 6 * * 1'
concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
security-events: write
jobs:
analyze:
name: CodeQL
runs-on: ubuntu-latest
steps:
- id: gate
env:
EVENT_NAME: ${{ github.event_name }}
HEAD_REF: ${{ github.event.pull_request.head.ref }}
BASE_REF: ${{ github.event.pull_request.base.ref }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_USER: ${{ github.event.pull_request.user.login }}
run: |
skip=false
if [ "$EVENT_NAME" = "pull_request" ] && \
[ "$PR_USER" = "github-actions[bot]" ] && \
[ "$BASE_REF" = "develop" ]; then
case "$HEAD_REF" in
chore/backmerge-*) skip=true ;;
esac
if [ "$PR_TITLE" = "chore(release): merge main into develop" ]; then
skip=true
fi
fi
echo "skip_heavy=${skip}" >> "$GITHUB_OUTPUT"
echo "skip_heavy=${skip}"
- name: Skip CodeQL for release back-merge
if: steps.gate.outputs.skip_heavy == 'true'
run: echo "Back-merge PR — required check CodeQL reports success without a scan."
- name: Checkout
if: steps.gate.outputs.skip_heavy != 'true'
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
- name: Initialize CodeQL
if: steps.gate.outputs.skip_heavy != 'true'
uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
with:
languages: javascript-typescript
- name: Autobuild
if: steps.gate.outputs.skip_heavy != 'true'
uses: github/codeql-action/autobuild@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
- name: Perform CodeQL Analysis
if: steps.gate.outputs.skip_heavy != 'true'
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4