Skip to content

Commit 395322a

Browse files
authored
use env if it existed (#360)
1 parent 02d6ac3 commit 395322a

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,24 @@ steps:
122122
- run: flutter --version
123123
```
124124

125+
### Use a Flutter mirror by set ENV
126+
127+
You can get more infomation from [Flutter official docs](https://docs.flutter.dev/community/china).
128+
129+
```yaml
130+
steps:
131+
- name: Clone repository
132+
uses: actions/checkout@v4
133+
- name: Set up Flutter
134+
env:
135+
FLUTTER_STORAGE_BASE_URL: https://storage.flutter-io.cn
136+
uses: subosito/flutter-action@v2
137+
with:
138+
channel: master
139+
flutter-version: 5b12b74 # tag, commit or branch
140+
- run: flutter --version
141+
```
142+
125143
### Use alternative Flutter repository
126144

127145
This action supports "alternative Flutters" in addition to the official

setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fi
1212

1313
OS_NAME=$(echo "$RUNNER_OS" | awk '{print tolower($0)}')
1414
ARCH_NAME=$(echo "$RUNNER_ARCH" | awk '{print tolower($0)}')
15-
MANIFEST_BASE_URL="https://storage.googleapis.com/flutter_infra_release/releases"
15+
MANIFEST_BASE_URL="${FLUTTER_STORAGE_BASE_URL:-https://storage.googleapis.com}/flutter_infra_release/releases"
1616
MANIFEST_JSON_PATH="releases_$OS_NAME.json"
1717
MANIFEST_URL="$MANIFEST_BASE_URL/$MANIFEST_JSON_PATH"
1818

0 commit comments

Comments
 (0)