Skip to content

use env if it existed #360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,24 @@ steps:
- run: flutter --version
```

### Use a Flutter mirror by set ENV

You can get more infomation from [Flutter official docs](https://docs.flutter.dev/community/china).

```yaml
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Set up Flutter
env:
FLUTTER_STORAGE_BASE_URL: https://storage.flutter-io.cn
uses: subosito/flutter-action@v2
with:
channel: master
flutter-version: 5b12b74 # tag, commit or branch
- run: flutter --version
```

### Use alternative Flutter repository

This action supports "alternative Flutters" in addition to the official
Expand Down
2 changes: 1 addition & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fi

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

Expand Down