Skip to content

Commit 0c73800

Browse files
authored
Refactor CodeQL workflow and use correct indentation (#1964)
This pull request updates the CodeQL workflow configuration in `.github/workflows/codeql.yml` to improve consistency and security permissions. The main changes are related to workflow syntax, permissions, and updating action versions. **Workflow configuration updates:** * Changed the `cron` schedule string to use double quotes for consistency. * Set `runs-on` to always use `ubuntu-latest`, removing the conditional selection for Swift. **Security and permissions:** * Added explicit `contents: read` and `actions: read` permissions for improved security and clarity. **Dependency updates:** * Updated the `actions/checkout` action from version `v4` to `v6` for the repository checkout step.
1 parent 569ef8a commit 0c73800

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

.github/workflows/codeql.yml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,37 @@ on:
66
pull_request:
77
branches: [ "main" ]
88
schedule:
9-
- cron: '18 3 * * 1'
9+
- cron: "18 3 * * 1"
1010

1111
jobs:
1212
analyze:
1313
name: Analyze (${{ matrix.language }})
14-
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
14+
runs-on: ubuntu-latest
1515
permissions:
1616
security-events: write
17+
contents: read
18+
actions: read
1719
packages: read
1820

1921
strategy:
2022
fail-fast: false
2123
matrix:
2224
include:
23-
- language: actions
24-
build-mode: none
25-
- language: python
26-
build-mode: none
25+
- language: actions
26+
build-mode: none
27+
- language: python
28+
build-mode: none
2729
steps:
28-
- name: Checkout repository
29-
uses: actions/checkout@v4
30+
- name: Checkout repository
31+
uses: actions/checkout@v6
3032

31-
- name: Initialize CodeQL
32-
uses: github/codeql-action/init@v4
33-
with:
34-
languages: ${{ matrix.language }}
35-
build-mode: ${{ matrix.build-mode }}
33+
- name: Initialize CodeQL
34+
uses: github/codeql-action/init@v4
35+
with:
36+
languages: ${{ matrix.language }}
37+
build-mode: ${{ matrix.build-mode }}
3638

37-
- name: Perform CodeQL Analysis
38-
uses: github/codeql-action/analyze@v4
39-
with:
40-
category: "/language:${{matrix.language}}"
39+
- name: Perform CodeQL Analysis
40+
uses: github/codeql-action/analyze@v4
41+
with:
42+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)