Skip to content

Commit 84b874a

Browse files
authored
Harden dependency management (#556)
1 parent f96195f commit 84b874a

10 files changed

Lines changed: 34 additions & 13 deletions

.github/renovate.json5

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
},
1313

1414
packageRules: [
15+
// Pre-commit hooks (digest-pin to commit SHA for supply chain hardening)
16+
{
17+
matchManagers: ["pre-commit"],
18+
pinDigests: true,
19+
},
20+
1521
// Dev dependencies (patch/minor)
1622
{
1723
matchDepTypes: ["devDependencies"],

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
with:
4747
python-version-file: ".python-version"
4848
- name: Check copyright headers
49-
run: uv run python scripts/check_copyright.py
49+
run: uv run --frozen python scripts/check_copyright.py
5050

5151
test-ecosystem-automation:
5252
name: Test ecosystem-automation
@@ -67,7 +67,7 @@ jobs:
6767
python-version-file: ".python-version"
6868

6969
- name: Install dependencies
70-
run: uv sync --all-extras --dev
70+
run: uv sync --locked --all-extras --dev
7171

7272
- name: Run collector-watcher tests
7373
run: |

.github/workflows/build-explorer-database.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,15 @@ jobs:
5454
run: |
5555
.github/scripts/use-cla-approved-bot.sh
5656
57-
- uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
57+
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
5858
if: steps.repo_check.outputs.is_primary == 'true'
5959
id: otelbot-token
6060
with:
6161
app-id: ${{ vars.OTELBOT_APP_ID }}
6262
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
63+
repositories: ${{ github.event.repository.name }}
64+
permission-contents: write
65+
permission-pull-requests: write
6366

6467
- name: Configure git (fork)
6568
if: steps.repo_check.outputs.is_primary == 'false'
@@ -78,7 +81,7 @@ jobs:
7881
python-version-file: ".python-version"
7982

8083
- name: Install dependencies
81-
run: uv sync
84+
run: uv sync --locked
8285

8386
- name: Build explorer database (incremental)
8487
if: inputs.build_mode == 'incremental'

.github/workflows/nightly-registry-update.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,15 @@ jobs:
4747
run: |
4848
.github/scripts/use-cla-approved-bot.sh
4949
50-
- uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
50+
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
5151
if: steps.repo_check.outputs.is_primary == 'true'
5252
id: otelbot-token
5353
with:
5454
app-id: ${{ vars.OTELBOT_APP_ID }}
5555
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
56+
repositories: ${{ github.event.repository.name }}
57+
permission-contents: write
58+
permission-pull-requests: write
5659

5760
- name: Configure git (forked repository)
5861
if: steps.repo_check.outputs.is_primary == 'false'
@@ -79,7 +82,7 @@ jobs:
7982
python-version-file: ".python-version"
8083

8184
- name: Install dependencies
82-
run: uv sync
85+
run: uv sync --locked
8386

8487
- name: Run collector-watcher
8588
id: collector_watcher

.github/workflows/screenshots-baseline.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,13 @@ jobs:
7272
cp ecosystem-explorer/screenshots/*.png /tmp/baseline/
7373
7474
- name: Get otelbot token
75-
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
75+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
7676
id: otelbot-token
7777
with:
7878
app-id: ${{ vars.OTELBOT_APP_ID }}
7979
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
80+
repositories: ${{ github.event.repository.name }}
81+
permission-contents: write
8082

8183
- name: Use CLA approved github bot
8284
run: .github/scripts/use-cla-approved-bot.sh

.github/workflows/screenshots-cleanup.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ jobs:
2727
runs-on: ubuntu-latest
2828
steps:
2929
- name: Get otelbot token
30-
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
30+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
3131
id: otelbot-token
3232
with:
3333
app-id: ${{ vars.OTELBOT_APP_ID }}
3434
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
35+
repositories: ${{ github.event.repository.name }}
36+
permission-contents: write
3537

3638
- name: Checkout repository
3739
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

.github/workflows/screenshots-commit.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,13 @@ jobs:
142142
git push origin otelbot/screenshots
143143
144144
- name: Get otelbot token
145-
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
145+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
146146
id: otelbot-token
147147
with:
148148
app-id: ${{ vars.OTELBOT_APP_ID }}
149149
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
150+
repositories: ${{ github.event.repository.name }}
151+
permission-issues: write
150152

151153
- name: Post or update PR comment
152154
env:

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.9.1
3+
rev: 18ba2d02dcafd1cc608bd83eff6c17fb0108ca71 # v0.9.1
44
hooks:
55
- id: ruff
66
args: [--fix]
77
- id: ruff-format
88

99
- repo: https://github.com/DavidAnson/markdownlint-cli2
10-
rev: v0.16.0
10+
rev: 1d349044b9624661f5a0a7e13e0ca9801752022a # v0.16.0
1111
hooks:
1212
- id: markdownlint-cli2
1313
args: ["--fix"]

ecosystem-automation/v1-registry-sync/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ dependencies = [
1010
[project.scripts]
1111
v1-registry-sync = "v1_registry_sync.main:main"
1212

13+
[tool.uv.sources]
14+
collector-watcher = { workspace = true }
15+
1316
[project.optional-dependencies]
1417
dev = [
1518
"pytest>=8.0.0",

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ line-length = 120
4040
target-version = "py311"
4141

4242
[tool.ruff.lint]
43-
select = ["E", "F", "I", "N", "W"]
43+
select = ["E", "F", "I", "N", "W", "S"]
4444

4545
[tool.pytest.ini_options]
4646
addopts = "--import-mode=importlib"
4747
testpaths = ["ecosystem-automation"]
48-
python_files = ["test_*.py", "*_test.py"]
48+
python_files = ["test_*.py", "*_test.py"]

0 commit comments

Comments
 (0)