diff --git a/.github/workflows/proxy_integration_tests.yml b/.github/workflows/proxy_integration_tests.yml new file mode 100644 index 0000000..caeb793 --- /dev/null +++ b/.github/workflows/proxy_integration_tests.yml @@ -0,0 +1,41 @@ +# Integration tests against a real proxy (PROXY_URL). Add repository secret PROXY_URL +# under Settings → Secrets and variables → Actions, then mark this workflow as a required +# status check under branch protection (pull_request events only receive secrets for PRs +# from the same repository, not from forks). + +name: Proxy integration tests + +on: + pull_request: + +permissions: + contents: read + +jobs: + integration: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + + - name: Set up Ruby + uses: ruby/setup-ruby@2e007403fc1ec238429ecaa57af6f22f019cc135 # v1.234.0 + with: + bundler-cache: true + ruby-version: ruby + + - name: Require PROXY_URL Actions secret + env: + PROXY_URL: ${{ secrets.PROXY_URL }} + run: | + if [ -z "${PROXY_URL}" ]; then + echo "::error::PROXY_URL is not set. Add a repository (or environment) secret named PROXY_URL under Settings → Secrets and variables → Actions." + exit 1 + fi + + - name: Run integration tests + env: + PROXY_URL: ${{ secrets.PROXY_URL }} + run: bundle exec ruby test/test_proxy_headers.rb diff --git a/README.md b/README.md index c661906..97cb3c6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![Gem Version](https://badge.fury.io/rb/ruby-proxy-headers.svg)](https://badge.fury.io/rb/ruby-proxy-headers) # Ruby Proxy Headers Send and receive custom proxy headers during HTTPS `CONNECT` tunneling in modern Ruby HTTP workflows (for example [ProxyMesh](https://proxymesh.com) `X-ProxyMesh-IP` / `X-ProxyMesh-Country`).