Skip to content

Commit 0e9adf4

Browse files
authored
chore: improve ci config (#10612)
2 parents 06ea97b + fb0cb71 commit 0e9adf4

11 files changed

+88
-37
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,15 @@ updates:
2626
commit-message:
2727
prefix: chore
2828
include: scope
29+
- package-ecosystem: pip
30+
open-pull-requests-limit: 10
31+
directories:
32+
- "/scripts/*"
33+
schedule:
34+
interval: "weekly"
35+
labels:
36+
- "type: dependency"
37+
- "type: pip"
38+
commit-message:
39+
prefix: chore
40+
include: scope
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Build - Scripts
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- 'scripts/**'
10+
- '.github/workflows/build-scripts.yml'
11+
pull_request:
12+
paths:
13+
- 'scripts/**'
14+
- '.github/workflows/build-scripts.yml'
15+
workflow_dispatch:
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
build-scripts:
22+
name: Build scripts
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 20
25+
steps:
26+
- name: Checkout the repo
27+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
28+
with:
29+
fetch-depth: 1
30+
31+
- name: Setup Python
32+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # @v6.2.0
33+
with:
34+
python-version: '3.14'
35+
36+
- name: Run Python script tests
37+
run: bash scripts/test_python_scripts.sh

.github/workflows/pr-auto-assign-reviewer.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
pull_request_target:
88
types: [review_requested]
99

10+
permissions:
11+
contents: none
12+
1013
jobs:
1114
pr-auto-assign-reviewer:
1215
permissions:

.github/workflows/pr-dependabot-dependency-guard-update.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ concurrency:
2222
cancel-in-progress: true
2323

2424
permissions:
25-
contents: read
25+
contents: write
2626

2727
jobs:
2828
pr-update-dependency-guard:
29-
permissions:
30-
contents: write
3129
if: github.actor == 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == 'thunderbird/thunderbird-android'
3230
runs-on: ubuntu-latest
3331
environment: botmobile

.github/workflows/pr-label-tb-team.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
pull_request_target:
88
types: [opened, reopened]
99

10+
permissions:
11+
contents: none
12+
1013
jobs:
1114
label-tb-team:
1215
permissions:

.github/workflows/pr-opened.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
branches: [beta, release]
99
types: [opened]
1010

11+
permissions:
12+
contents: none
13+
1114
jobs:
1215
pr-opened:
1316
permissions:

.github/workflows/security-scorecard.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,14 @@
22
name: Security - Scorecard
33

44
on:
5-
# For Branch-Protection check. Only the default branch is supported. See
6-
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
75
branch_protection_rule:
8-
# To guarantee Maintained check is occasionally updated. See
9-
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
106
schedule:
117
- cron: '19 22 * * 3'
128
push:
139
branches: [ "main" ]
1410
workflow_dispatch:
1511

16-
permissions:
17-
contents: read
12+
permissions: read-all
1813

1914
jobs:
2015
security-scorecard:
@@ -37,14 +32,6 @@ jobs:
3732
with:
3833
results_file: results.sarif
3934
results_format: sarif
40-
41-
# Public repositories:
42-
# - Publish results to OpenSSF REST API for easy access by consumers
43-
# - Allows the repository to include the Scorecard badge.
44-
# - See https://github.com/ossf/scorecard-action#publishing-results.
45-
# For private repositories:
46-
# - `publish_results` will always be set to `false`, regardless
47-
# of the value entered here.
4835
publish_results: true
4936

5037
# Upload the results as artifacts.

mise.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[tools]
2+
java = "temurin-21"
3+
python = "3.14"

scripts/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Various scripts for CI/CD, release automation, and development tasks.
66

77
### Setup
88

9-
Install dependencies (all pinned and CVE-free):
9+
Install direct dependencies (hashed, no transitive deps):
1010

1111
```bash
12-
pip install -r requirements.txt
12+
python3 -m pip install -r scripts/requirements.txt
1313
```
1414

1515
### Available Scripts
@@ -29,7 +29,7 @@ It's recommended to use a virtual environment:
2929
```bash
3030
python3 -m venv venv
3131
source venv/bin/activate # On macOS/Linux
32-
pip install -r requirements.txt
32+
python3 -m pip install -r scripts/requirements.txt
3333
```
3434

3535
To deactivate: `deactivate`
@@ -39,7 +39,7 @@ To deactivate: `deactivate`
3939
To verify everything works:
4040

4141
```bash
42-
./test_python_scripts.sh
42+
./scripts/test_python_scripts.sh
4343
```
4444

4545
This creates a temporary environment, installs dependencies, runs tests, and cleans up automatically.

scripts/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Python dependencies for scripts in this directory
22
# Install with: pip install -r requirements.txt
33

4-
# Direct dependencies - all pinned and CVE-free
4+
# Direct dependencies - all pinned by version and hash
55

66
# Required by: scripts/ci/setup_release_automation
77
# Cryptography library for GitHub secret encryption

0 commit comments

Comments
 (0)