Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(screener): disable screener PR checks #5253

Merged
merged 2 commits into from
Sep 2, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 2 additions & 39 deletions .github/workflows/pr-screener.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,22 @@
name: Screener
on:
pull_request:
branches: [master]
# need to run on the base branch when merging to keep the baseline state up to date
push:
branches: [master]
workflow_dispatch:
jobs:
screenshot_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: skip for markdown only prs
id: one
run: |
current_branch=$(git rev-parse --abbrev-ref HEAD)
echo "branch: $current_branch"
if [ "$current_branch" == "master" ]; then
# diff of last commit excluding md (assumes squash merge)
screenable_changes=$(git diff --name-only @~..@ -- . ':(exclude)*.md*')
echo "push run"
else
# diff of branch excluding md
screenable_changes=$(git diff --name-only "$current_branch" $(git merge-base "$current_branch" origin/master) -- . ':(exclude)*.md*')
echo "pr run"
fi
echo "changed files: $screenable_changes"
# skip if there are only md changes
if [ -z "$screenable_changes" ]; then
echo "skip screener"
echo "::set-output name=skip::skip"
else
echo "run screener"
echo "::set-output name=skip::screen"
fi
- uses: actions/setup-node@v2
with:
node-version: lts/*
cache: npm
- run: npm ci --legacy-peer-deps
- if: steps.one.outputs.skip == 'screen'
name: run screener check
- name: run screener check
env:
SCREENER_API_KEY: ${{ secrets.SCREENER_API_KEY }}
COMMIT_SHA: ${{github.event.pull_request.head.sha || github.sha}}
SAUCE_ACCESS_NAME: ${{ secrets.SAUCE_ACCESS_NAME}}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
run: npm run test:storybook || true
- if: steps.one.outputs.skip == 'skip'
name: skip screener
uses: Sibz/github-status-action@v1
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
context: screener
description: Screener run skipped (markdown PRs)
state: success
sha: ${{github.event.pull_request.head.sha || github.sha}}