Skip to content

Commit 8d53dbf

Browse files
mokevninclaude
andcommitted
ci: закрепить actions по SHA и ограничить права workflows
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 4e2abca commit 8d53dbf

3 files changed

Lines changed: 37 additions & 7 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ updates:
33
# Экосистема uv покрывает и pyproject.toml, и uv.lock. Отдельный блок pip на
44
# том же каталоге давал бы вторую пачку PR на те же зависимости.
55
- package-ecosystem: "uv"
6+
cooldown:
7+
default-days: 7
68
directory: "/"
79
schedule:
810
interval: "monthly"
@@ -15,6 +17,8 @@ updates:
1517
patterns: ["*"]
1618

1719
- package-ecosystem: "github-actions"
20+
cooldown:
21+
default-days: 7
1822
directory: "/"
1923
schedule:
2024
interval: "monthly"
@@ -27,6 +31,8 @@ updates:
2731
patterns: ["*"]
2832

2933
- package-ecosystem: "docker"
34+
cooldown:
35+
default-days: 7
3036
directory: "/"
3137
schedule:
3238
interval: "monthly"

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,18 @@ on:
1212
- synchronize
1313
- reopened
1414

15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
17+
cancel-in-progress: true
18+
1519
permissions:
1620
pull-requests: read
1721

1822
jobs:
1923
lint:
2024
runs-on: ubuntu-latest
25+
timeout-minutes: 15
2126
steps:
22-
- uses: amannn/action-semantic-pull-request@v6
27+
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
2328
env:
2429
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎.github/workflows/python-ci.yml‎

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,30 @@ on:
88
branches:
99
- main
1010

11+
permissions: {}
12+
13+
# Образ латеста пушится из main: параллельные прогоны ждут друг друга, а не
14+
# отменяются, чтобы не оборвать публикацию.
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
17+
cancel-in-progress: false
18+
1119
jobs:
1220
build:
1321
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
timeout-minutes: 15
1425

1526
steps:
16-
- uses: actions/checkout@v7
27+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
28+
with:
29+
persist-credentials: false
1730

1831
# setup-python не нужен: версию питона держит .python-version, и uv сам
1932
# ставит её при первом `uv sync`. Единый источник версии, поэтому раннер
2033
# и образ кита не могут разойтись.
21-
- uses: astral-sh/setup-uv@v10.0.1
34+
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
2235

2336
- name: Install
2437
run: make install
@@ -31,22 +44,28 @@ jobs:
3144
deploy:
3245
needs: build
3346
runs-on: ubuntu-latest
47+
timeout-minutes: 15
3448
if: ${{ github.event_name == 'push' }}
49+
permissions:
50+
contents: read
51+
packages: write
3552

3653
steps:
37-
- uses: actions/checkout@v7
54+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
55+
with:
56+
persist-credentials: false
3857

39-
- uses: docker/setup-buildx-action@v4
58+
- uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
4059

4160
- name: Log in to GitHub Container Registry
42-
uses: docker/login-action@v4
61+
uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0
4362
with:
4463
registry: ghcr.io
4564
username: ${{ github.actor }}
4665
password: ${{ secrets.GITHUB_TOKEN }}
4766

4867
- name: Build and push
49-
uses: docker/build-push-action@v7
68+
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
5069
with:
5170
context: .
5271
push: true

0 commit comments

Comments
 (0)