Update workflow for PRs to require safe-to-test label to run BrowserStack tests

This commit is contained in:
zinduolis
2026-01-27 09:05:28 +10:00
parent ddc27c8880
commit 2b653a982f

View File

@@ -2,18 +2,34 @@ name: 'BrowserStack Test'
on: on:
pull_request_target: pull_request_target:
types: [opened, synchronize, reopened, labeled]
branches: [ master ] branches: [ master ]
jobs: jobs:
ubuntu-job: ubuntu-job:
name: 'BrowserStack Test on Ubuntu' name: 'BrowserStack Test on Ubuntu'
if: contains(github.event.pull_request.labels.*.name, 'safe-to-test')
runs-on: ubuntu-latest # Can be self-hosted runner also runs-on: ubuntu-latest # Can be self-hosted runner also
permissions:
contents: read
pull-requests: write
environment: environment:
name: Integrate Pull Request name: Integrate Pull Request
env: env:
GITACTIONS: true GITACTIONS: true
steps: steps:
- name: 'Remove safe-to-test label'
uses: actions/github-script@v6
with:
script: |
github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'safe-to-test'
})
- name: 'BrowserStack Env Setup' # Invokes the setup-env action - name: 'BrowserStack Env Setup' # Invokes the setup-env action
uses: browserstack/github-actions/setup-env@master uses: browserstack/github-actions/setup-env@master
with: with: