Skip to content

PERCY_POSTINSTALL_BROWSER set to "0" or "false" should not trigger browser download #443

PERCY_POSTINSTALL_BROWSER set to "0" or "false" should not trigger browser download

PERCY_POSTINSTALL_BROWSER set to "0" or "false" should not trigger browser download #443

name: SDK Regression
on:
issue_comment:
types: [created, edited]
jobs:
regression:
name: regression
runs-on: ubuntu-latest
if: ${{ github.event.issue.pull_request && github.event.comment.body == 'RUN_REGRESSION' }}
strategy:
matrix:
# Format: repo@branch (default branch is master)
repo:
- percy-ember
- percy-cypress
- percy-puppeteer
- percy-storybook
- percy-playwright
- percy-testcafe
- percy-nightwatch
- percy-nightmare
- percy-webdriverio
- percy-webdriverio@v2
- percy-protractor
- percy-selenium-js
- percy-selenium-dotnet
- percy-selenium-java
- percy-selenium-python
- percy-selenium-ruby@main
- percy-capybara
- percy-appium-js
- gatsby-plugin-percy
steps:
- name: Get user permissions
uses: actions/github-script@v4
id: check-access
with:
script: |
const { owner, repo } = context.repo;
const { login } = context.payload.comment.user;
const { data } = await github.repos.getCollaboratorPermissionLevel({ owner, repo, username: login });
return data.permission;
result-encoding: string
- name: Check Access Level
if: steps.check-access.outputs.result != 'write' && steps.check-access.outputs.result != 'admin'
run: exit 1
- uses: xt0rted/pull-request-comment-branch@v2
if: ${{ github.event.issue.pull_request }}
id: comment-branch
- uses: actions-ecosystem/action-regex-match@v2
id: regex-match
with:
text: ${{ steps.comment-branch.outputs.head_ref }}
regex: '^[a-zA-Z0-9_/\-]+$'
- name: Break on invalid branch name
run: exit 1
if: ${{ steps.regex-match.outputs.match == '' }}
- name: Get Current Job Log URL
uses: Tiryoh/gha-jobid-action@v0
id: job-url
with:
github_token: ${{ secrets.WORKFLOW_DISPATCH_ACTIONS_TOKEN }}
job_name: "regression (${{ matrix.repo }})"
- name: Output Current Job Log URL
run: echo ${{ steps.jobs.outputs.html_url }}
- uses: actions/github-script@v4
with:
github-token: ${{ secrets.WORKFLOW_DISPATCH_ACTIONS_TOKEN }}
script: |
const { owner, repo } = context.repo;
const sha = '${{ steps.comment-branch.outputs.head_sha }}'
const state = 'pending';
const target_url = '${{ steps.job-url.outputs.html_url }}'
const check_name = 'SDK Regression ${{ matrix.repo }}'
github.repos.createCommitStatus({
context: check_name,
owner,
repo,
sha,
state,
target_url
});
- uses: winterjung/split@v2
id: split
with:
msg: ${{ matrix.repo }}
separator: '@'
- name: Trigger Workflow & Wait
uses: convictional/trigger-workflow-and-wait@v1.6.5
id: reg-test
with:
owner: percy
repo: ${{ steps.split.outputs._0 }}
github_token: ${{ secrets.WORKFLOW_DISPATCH_ACTIONS_TOKEN }}
workflow_file_name: test.yml
ref: ${{ steps.split.outputs._1 || 'master' }}
client_payload: '{ "branch": "${{ steps.comment-branch.outputs.head_ref }}"}'
wait_interval: 15
- name: Update Status
uses: actions/github-script@v4
with:
github-token: ${{ secrets.WORKFLOW_DISPATCH_ACTIONS_TOKEN }}
script: |
const { owner, repo } = context.repo;
const sha = '${{ steps.comment-branch.outputs.head_sha }}'
const state = '${{ steps.reg-test.outcome }}';
const target_url = '${{ steps.job-url.outputs.html_url }}'
const check_name = 'SDK Regression ${{ matrix.repo }}'
github.repos.createCommitStatus({
context: check_name,
owner,
repo,
sha,
state,
target_url
});