Skip to content

Commit 987c2a7

Browse files
chore(ci): restrict deploy and release secrets to protected environments (#977)
1 parent 0a7697e commit 987c2a7

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎.github/workflows/deploy-docs.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ name: Deploy Docs
33
on:
44
workflow_dispatch:
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
deploy:
811
name: Build & Deploy
912
runs-on: ubuntu-latest
13+
# Секреты деплоя лежат в environment, который разрешён только для main:
14+
# запуск с произвольной ветки не получит SSH-ключ сервера.
15+
environment: docs-production
1016

1117
steps:
1218
- name: Checkout code

‎.github/workflows/release.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,16 @@ on:
1111
required: true
1212
default: v4.0.0
1313

14+
permissions:
15+
contents: write
16+
1417
jobs:
1518
build:
1619
name: Build for ${{ matrix.os }}
1720
runs-on: ${{ matrix.os }}
21+
# Сертификат подписи и Apple-креды доступны только из environment,
22+
# разрешённого для тегов v*.
23+
environment: release
1824
env:
1925
NODE_OPTIONS: --max-old-space-size=4096
2026
strategy:

0 commit comments

Comments
 (0)