Skip to content

saucelabs/sauce-connect-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Sauce Connect Proxy GitHub Action

A GitHub action to launch Sauce Connect Proxy.

Example

jobs:
    test:
        runs-on: ubuntu-latest
        name: Action Test
        steps:
            # ...
            - uses: actions/checkout@v4  # reference files in the current repository
            - uses: saucelabs/sauce-connect-action@v3
              with:
                  username: ${{ secrets.SAUCE_USERNAME }}
                  accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
                  region: us
                  tunnelName: github-action-tunnel
                  configFile: ${{ github.workspace }}/sc-configuration/config.yaml
            # ...

Migration from v2 to v3

Please refer to Migrating from Sauce Connect Proxy 4

Inputs

username:

Required Sauce Labs user name.

accessKey:

Required Sauce Labs API Access Key.

region:

Required Sauce Labs region.

configFile:

Sauce Connect Proxy configuration file.

Only an absolute path to the file is supported at the moment (i.e. must prepend the relative path to the file in the repo with github.workspace, see the example above).

scVersion:

(Optional) version of the saucelabs/sauce-connect client. Use the latest sauce-connect release by default. Current latest version can be found in the official documentation

retryTimeout:

Do not retry if this amount of minutes has passed since starting. (default: "10")

Additional configuration

Please refer to action.yml or Sauce Labs documentation for each option documentation.

Sauce Connect Proxy log

Sometimes, it's beneficial to access the Sauce Connect Proxy log for debugging or an audit.

It can be done with upload-artifact GitHub Action. Optionally, a failure condition may be specified to store the log only in case of a failure.

jobs:
    test:
        runs-on: ubuntu-latest
        name: Action Test
        steps:
            # ...
            - uses: actions/checkout@v3  # reference files in the current repository
            - uses: saucelabs/sauce-connect-action@v2
              with:
                  username: ${{ secrets.SAUCE_USERNAME }}
                  accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
                  region: us
                  tunnelName: github-action-tunnel
                  configFile: ${{ github.workspace }}/sc-configuration/config.yaml
            # ...

            - uses: actions/upload-artifact@v4
              if: ${{ failure() }}
              with:
                name: sauce-connect-log
                path: ${{ env.SAUCE_CONNECT_DIR_IN_HOST }}/sauce-connect.log

Development

Run locally

INPUT_REGION=us-west-1 INPUT_TUNNELNAME=sauce-connect-test INPUT_USERNAME=username INPUT_ACCESSKEY=accesskey node ./dist/main/index.js