Skip to content

Commit 630a01f

Browse files
committed
[actions] fix workflow permissions; add codeQL
1 parent b7b7e94 commit 630a01f

File tree

3 files changed

+59
-26
lines changed

3 files changed

+59
-26
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "Code scanning - action"
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 17 * * 4'
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
CodeQL-Build:
14+
15+
# CodeQL runs on ubuntu-latest and windows-latest
16+
permissions:
17+
actions: read # for github/codeql-action/init to get workflow details
18+
contents: read # for actions/checkout to fetch code
19+
security-events: write # for github/codeql-action/autobuild to send a status report
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v6
25+
with:
26+
persist-credentials: false
27+
28+
# Initializes the CodeQL tools for scanning.
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@v4
31+
# Override language selection by uncommenting this and choosing your languages
32+
# with:
33+
# languages: go, javascript, csharp, python, cpp, java
34+
35+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
36+
# If this step fails, then you should remove it and run the build manually (see below)
37+
- name: Autobuild
38+
uses: github/codeql-action/autobuild@v4
39+
40+
# ℹ️ Command-line programs to run using the OS shell.
41+
# 📚 https://git.io/JvXDl
42+
43+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
44+
# and modify them (or add more) to build your code if your project
45+
# uses a compiled language
46+
47+
#- run: |
48+
# make bootstrap
49+
# make release
50+
51+
- name: Perform CodeQL Analysis
52+
uses: github/codeql-action/analyze@v4

.github/workflows/rebase.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,16 @@ name: Automatic Rebase
22

33
on: [pull_request_target]
44

5-
permissions:
6-
contents: read
5+
permissions: read-all
76

87
jobs:
98
_:
10-
permissions:
11-
contents: write
129
name: "Automatic Rebase"
1310

1411
runs-on: ubuntu-latest
1512

1613
steps:
17-
- name: Harden Runner
18-
uses: step-security/harden-runner@v2
19-
with:
20-
allowed-endpoints:
21-
api.github.com:443
22-
github.com:443
23-
- uses: actions/checkout@v4
24-
- uses: ljharb/rebase@master
25-
env:
26-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
- uses: actions/checkout@v2
15+
- uses: ljharb/rebase@master
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/require-allow-edits.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,13 @@ name: Require “Allow Edits”
22

33
on: [pull_request_target]
44

5-
permissions:
6-
contents: read
5+
permissions: read-all
76

87
jobs:
98
_:
10-
permissions:
11-
pull-requests: read
129
name: "Require “Allow Edits”"
1310

1411
runs-on: ubuntu-latest
1512

1613
steps:
17-
- name: Harden Runner
18-
uses: step-security/harden-runner@v2
19-
with:
20-
allowed-endpoints:
21-
api.github.com:443
22-
- uses: ljharb/require-allow-edits@main
23-
env:
24-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
- uses: ljharb/require-allow-edits@main

0 commit comments

Comments
 (0)