| 1 | name: No http imports |
| 2 | |
| 3 | on: [pull_request] |
| 4 | |
| 5 | jobs: |
| 6 | PR_test_build: |
| 7 | runs-on: ubuntu-24.04 |
| 8 | |
| 9 | steps: |
| 10 | - uses: actions/checkout@v4 |
| 11 | - name: Check for http package usage |
| 12 | if: github.event_name == 'pull_request' |
| 13 | run: | |
| 14 | GIT_GREP_OUT="$(git grep package:http | (grep .dart: || test $? = 1) | (grep -v proxy_wrapper.dart || test $? = 1) | (grep -v very_insecure_http_do_not_use || test $? = 1) | (grep -v '^cw_custom_lints/' || test $? = 1) || true)" |
| 15 | [[ "x$GIT_GREP_OUT" == "x" ]] && exit 0 |
| 16 | echo "$GIT_GREP_OUT" |
| 17 | echo "There are .dart files which use http imports" |
| 18 | echo "Using http package breaks proxy integration" |
| 19 | echo "Please use ProxyWrapper.getHttpClient() from package:cw_core/utils/proxy_wrapper.dart" |
| 20 | exit 1 |