Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/ABI-Software/sparc-app into…
Browse files Browse the repository at this point in the history
… e2e-testing
  • Loading branch information
alan-wu committed Oct 17, 2023
2 parents 5ca6f5b + 83f7818 commit 0382e9e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,28 +49,34 @@ jobs:
steps:
- run: echo "event name is:" ${{ github.event_name }}
- uses: actions-cool/check-user-permission@main
if: github.event_name == 'pull_request_target'
id: checkUser
with:
require: 'write'
username: ${{ github.event.pull_request.user.name }}
if: github.event_name == 'pull_request_target'
- name: Checkout
if: github.event_name == 'pull_request_target' && steps.checkUser.outputs.require-result == 'true'
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
if: github.event_name == 'pull_request_target' && steps.checkUser.outputs.check-result == 'true'
- name: Checkout
uses: actions/checkout@v3
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 14.17.6
- name: Run e2e tests
if: github.event_name == 'workflow_dispatch' || steps.checkUser.outputs.require-result == 'true'
uses: cypress-io/github-action@v6
with:
build: yarn build
start: yarn start
wait-on: ${{ secrets.ROOT_URL }}
command: yarn test-run-e2e
if: github.event_name == 'workflow_dispatch' || steps.checkUser.outputs.check-result == 'true'
- name: Skip tests
if: github.event_name == 'pull_request_target' || steps.checkUser.outputs.require-result == 'false'
uses: actions/github-script@v3
with:
script: |
core.setFailed('Pull request is opened by an user without write permission, tests are skipped for security reason')

0 comments on commit 0382e9e

Please sign in to comment.