Skip to content

Commit 83eede6

Browse files
authored
feat: add ssh key setup step (#131)
* feat: add ssh key setup step * docs: update
1 parent ce39d19 commit 83eede6

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

.github/workflows/dart_package.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ on:
5555
required: false
5656
type: string
5757
default: "."
58+
secrets:
59+
ssh_key:
60+
required: false
5861

5962
jobs:
6063
build:
@@ -73,6 +76,14 @@ jobs:
7376
with:
7477
sdk: ${{inputs.dart_sdk}}
7578

79+
- name: 🤫 Set SSH Key
80+
env:
81+
ssh_key: ${{secrets.ssh_key}}
82+
if: env.ssh_key != null
83+
uses: webfactory/[email protected]
84+
with:
85+
ssh-private-key: ${{secrets.ssh_key}}
86+
7687
- name: 📦 Install Dependencies
7788
run: dart pub get
7889

.github/workflows/flutter_package.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ on:
5959
required: false
6060
type: string
6161
default: "!*"
62+
secrets:
63+
ssh_key:
64+
required: false
6265

6366
jobs:
6467
build:
@@ -80,6 +83,14 @@ jobs:
8083
cache: true
8184
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
8285

86+
- name: 🤫 Set SSH Key
87+
env:
88+
ssh_key: ${{secrets.ssh_key}}
89+
if: env.ssh_key != null
90+
uses: webfactory/[email protected]
91+
with:
92+
ssh-private-key: ${{secrets.ssh_key}}
93+
8394
- name: 📦 Install Dependencies
8495
run: |
8596
flutter pub global activate very_good_cli

site/docs/workflows/dart_package.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ The Dart package workflow consists of the following steps:
9797

9898
**Default** `"vm"`
9999

100+
## Secrets
101+
102+
### `ssh_key`
103+
104+
**Optional** An SSH key used to access private repositories when installing dependencies.
105+
100106
## Example Usage
101107

102108
```yaml
@@ -112,4 +118,6 @@ jobs:
112118
dart_sdk: 'stable'
113119
platform: 'chrome,vm'
114120
working_directory: 'examples/my_dart_package'
121+
secrets:
122+
ssh_key: ${{secrets.EXAMPLE_KEY}}
115123
```

site/docs/workflows/flutter_package.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ The Flutter package workflow consists of the following steps:
104104

105105
**Default** `"!*"`
106106

107+
## Secrets
108+
109+
### `ssh_key`
110+
111+
**Optional** An SSH key used to access private repositories when installing dependencies.
112+
107113
## Example Usage
108114

109115
```yaml
@@ -120,4 +126,6 @@ jobs:
120126
flutter_version: '2.8.1'
121127
working_directory: 'examples/my_flutter_package'
122128
test_recursion: true
129+
secrets:
130+
ssh_key: ${{secrets.EXAMPLE_KEY}}
123131
```

0 commit comments

Comments
 (0)