GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — github-actions/setup-env at master · browserstack/github-actions

Expand file tree

/

setup-env

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

setup-env

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
config
config
 
 
dist
dist
 
 
src
src
 
 
test/actionInput
test/actionInput
 
 
.eslintrc.js
.eslintrc.js
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
action.yml
action.yml
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 

README.md

Outline

setup-env

This action sets up the following environment variables in the runner environment. These environment variables shall be used in the tests for BrowserStack:

  1. BROWSERSTACK_BUILD_NAME: This environment variable is set only when you pass the build-name input. If you do not pass it, the variable is left unset so that the build name configured in your own test setup (e.g. browserstack.json / browserstack.yml) is used. Pass the BUILD_INFO keyword to get a name generated from the event, i.e. push, pull_request etc for the workflow:

    1. push event: [<Branch-Name>] Commit <commit-sha>: <commit-message> [Workflow: <Workflow-number>]
    2. pull_request event: [<Branch-Name>] PR <PR-number>: <PR-title> [Workflow: <Workflow-number>]
    3. release event: [<Branch-Name>] Release <Release-tag>: <Release-name> [Workflow: <Workflow-number>]
    4. Other events: <Event-Name> [Workflow: <Workflow-number>]
  2. BROWSERSTACK_PROJECT_NAME: This environment variable is set only when you pass the project-name input. If you do not pass it, the variable is left unset so that the project name configured in your own test setup is used. Pass the REPO_NAME keyword to use the Repository Name.

  3. BROWSERSTACK_USERNAME: This environment variable's value is taken from the input to username field. Ideal way would be to pass the GitHub Secret as the input, i.e. username: ${{ secrets.BROWSERSTACK_USERNAME }}.

  4. BROWSERSTACK_ACCESS_KEY: This environment variable's value is taken from the input to access-key field. Ideal way would be to pass the GitHub Secret as the input, i.e. access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}.

Prerequisites

  • This action does not have any prerequisites.

Usage

- name: 'BrowserStack Env Setup'
  uses: 'browserstack/github-actions/setup-env@master'
  with:
    username:  ${{ secrets.BROWSERSTACK_USERNAME }}
    access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
    build-name: BUILD_INFO
    project-name: REPO_NAME

or

- name: 'BrowserStack Env Setup'
  uses: 'browserstack/github-actions/setup-env@master'
  with:
    username:  ${{ secrets.BROWSERSTACK_USERNAME }}
    access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}

Inputs

  • username: (Mandatory) This is your BrowserStack Username. This should ideally be passed via a GitHub Secret as shown in the sample workflow above.
  • access-key: (Mandatory) This is your BrowserStack Access key that is required to access the BrowserStack device cloud. This should also ideally be passed via a GitHub Secret as shown in the sample workflow above.
  • build-name: (Optional)
    • You can pass any string that you want to set as the BROWSERSTACK_BUILD_NAME. E.g. build-name: My Build Name Goes Here.
    • You can also include your personalized string along with the keyword BUILD_INFO in the input:
      • build-name: My String Goes Here - BUILD_INFO
      • build-name: BUILD_INFO - My String at the end
      • build-name: String at the Beginning - BUILD_INFO - String at the end
    • The keyword BUILD_INFO will be replaced by the information based on the event of the workflow as described above for BROWSERSTACK_BUILD_NAME environment variable.
    • If you omit this input entirely, BROWSERSTACK_BUILD_NAME is not exported and your own configured build name is left untouched.
  • project-name: (Optional)
    • You can pass any string that you want to set as the BROWSERSTACK_PROJECT_NAME. E.g. project-name: My Project Name Goes Here.
    • You can also pass the keyword REPO_NAME as the input. This will set the Repository Name for the BROWSERSTACK_PROJECT_NAME environment variable.
    • If you omit this input entirely, BROWSERSTACK_PROJECT_NAME is not exported and your own configured project name is left untouched.

NOTE

  • This action is a prerequisite for any other BrowserStack related actions.
  • This action should be invoked prior to the execution of tests on BrowserStack to be able to utilise the environment variables in your tests.
  • You have to use the environment variables set by this action in your test script.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.