Skip to content

Commit 6ada4e9

Browse files
authored
chore(ci): enable codeql scanning for actions (#913)
1 parent cd7a82b commit 6ada4e9

File tree

7 files changed

+35
-47
lines changed

7 files changed

+35
-47
lines changed

.github/workflows/check-pr-title.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@ name: "Check PR Title"
22
on:
33
pull_request:
44
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled, converted_to_draft, edited]
5+
permissions:
6+
pull-requests: read
57

68
jobs:
79
check-pr-title:
810
name: Check PR Title
911
runs-on: ubuntu-latest
1012
steps:
1113
- name: Enforce conventional commit style
12-
uses: realm/ci-actions/title-checker@main
14+
uses: realm/ci-actions/title-checker@d6cc8f067474759d38e6d24e272027b4c88bc0a9
1315
with:
1416
regex: '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test|ops){1}(\([\w\-\.]+\))?(!)?: .*'
1517
error-hint: 'Invalid PR title. Make sure it follows the conventional commit specification (i.e. "<type>(<optional scope>): <description>") or add the no-title-validation label'
1618
ignore-labels: 'no-title-validation'
1719
- name: Enforce JIRA ticket in title
18-
uses: realm/ci-actions/title-checker@main
20+
uses: realm/ci-actions/title-checker@d6cc8f067474759d38e6d24e272027b4c88bc0a9
1921
# Skip the JIRA ticket check for PRs opened by bots
2022
if: ${{ !contains(github.event.pull_request.user.login, '[bot]') }}
2123
with:

.github/workflows/codeql.yml

Lines changed: 14 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,24 @@
1-
# For most projects, this workflow file will not need changing; you simply need
2-
# to commit it to your repository.
3-
#
4-
# You may wish to alter this file to override the set of languages analyzed,
5-
# or to provide custom queries or build logic.
6-
#
7-
# ******** NOTE ********
8-
# We have attempted to detect the languages in your repository. Please check
9-
# the `language` matrix defined below to confirm you have the correct set of
10-
# supported CodeQL languages.
11-
#
12-
name: "CodeQL"
1+
name: CodeQL
132

143
on:
154
push:
16-
branches: [ "main" ]
5+
branches:
6+
- main
177
pull_request:
18-
# The branches below must be a subset of the branches above
19-
branches: [ "main" ]
8+
branches:
9+
- main
2010
schedule:
2111
- cron: '32 18 * * 6'
2212

13+
permissions:
14+
contents: read
15+
security-events: write
16+
2317
jobs:
2418
analyze:
2519
name: Analyze
26-
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
27-
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 360
2822
permissions:
2923
actions: read
3024
contents: read
@@ -33,27 +27,18 @@ jobs:
3327
strategy:
3428
fail-fast: false
3529
matrix:
36-
language: [ 'javascript' ]
37-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
38-
# Use only 'java' to analyze code written in Java, Kotlin or both
39-
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
40-
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
30+
language:
31+
- javascript
32+
- actions
4133

4234
steps:
4335
- name: Checkout repository
4436
uses: actions/checkout@v4
4537

46-
# Initializes the CodeQL tools for scanning.
4738
- name: Initialize CodeQL
4839
uses: github/codeql-action/init@v3
4940
with:
5041
languages: ${{ matrix.language }}
51-
# If you wish to specify custom queries, you can do so here or in a config file.
52-
# By default, queries listed here will override any specified in a config file.
53-
# Prefix the list here with "+" to use these queries and those in the config file.
54-
55-
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
56-
# queries: security-extended,security-and-quality
5742
config: |
5843
paths-ignore:
5944
- '**/*.test.js'
@@ -63,21 +48,6 @@ jobs:
6348
- '**/*.test.tsx'
6449
- '**/*.spec.tsx'
6550
66-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
67-
# If this step fails, then you should remove it and run the build manually (see below)
68-
- name: Autobuild
69-
uses: github/codeql-action/autobuild@v3
70-
71-
# ℹ️ Command-line programs to run using the OS shell.
72-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
73-
74-
# If the Autobuild fails above, remove it and uncomment the following three lines.
75-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
76-
77-
# - run: |
78-
# echo "Run, Build Application using script"
79-
# ./location_of_script_within_repo/buildscript.sh
80-
8151
- name: Perform CodeQL Analysis
8252
uses: github/codeql-action/analyze@v3
8353
with:

.github/workflows/draft-release.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ on:
1818
description: 'Exact version: (Only effective selecting "exact-version" as version bump)'
1919
required: false
2020

21+
permissions:
22+
contents: write
23+
2124
jobs:
2225
prepare-release:
2326
runs-on: ubuntu-latest

.github/workflows/publish-release.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
release:
55
types: [published]
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
publish-release:
912
name: Publish Release

.github/workflows/rebuild-changelog.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on:
1212
schedule:
1313
- cron: "0 3 * * *"
1414

15+
permissions:
16+
contents: write
17+
pull-requests: write
18+
1519
jobs:
1620
rebuild-changelog:
1721
name: Rebuild changelog
@@ -63,7 +67,7 @@ jobs:
6367

6468
- name: Create Pull Request
6569
id: cpr
66-
uses: peter-evans/create-pull-request@v6
70+
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # 7.0.6
6771
with:
6872
commit-message: Update changelog
6973
base: main

.github/workflows/report-nightly-build-failures.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
types:
1111
- completed
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
on-failure:
1518
runs-on: ubuntu-latest

.github/workflows/test-and-build.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
schedule:
1111
- cron: "0 0 * * *"
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
test-and-build:
1518
name: Test and Build

0 commit comments

Comments
 (0)