Skip to content

Commit bb52b8e

Browse files
committed
add pr status checks
1 parent da179f7 commit bb52b8e

1 file changed

Lines changed: 32 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
name: ci pipeline
22
on:
3-
workflow_dispatch:
3+
44
# push:
55
# branches:
66
# - "*"
7-
# pull_request:
8-
# branches: [ main, master ]
7+
8+
pull_request:
9+
branches: [ main, master ]
10+
11+
workflow_dispatch:
12+
913
env:
1014
EMAIL: ${{ secrets.EMAIL }}
1115
PASSWORD: ${{ secrets.PASSWORD }}
16+
1217
jobs:
1318
test:
1419
timeout-minutes: 60
@@ -40,4 +45,27 @@ jobs:
4045
uses: peaceiris/actions-gh-pages@v3
4146
with:
4247
github_token: ${{ secrets.GITHUB_TOKEN }}
43-
publish_dir: playwright-report/
48+
publish_dir: playwright-report/
49+
50+
status_checks:
51+
name: E2E status checks
52+
runs-on: ubuntu-latest
53+
if: always()
54+
needs: test
55+
steps:
56+
- name: determine status check conclusion
57+
id: status-check-status
58+
run: |
59+
if [[ "${{ needs.test.result == 'failure' }}" ]]; then
60+
echo "status=failure" >> $GITHUB_OUTPUT
61+
else
62+
echo "status=success" >> $GITHUB_OUTPUT
63+
fi
64+
- name: set pr status checks
65+
uses: teamniteo/pull_request_status_action@v1.0.0
66+
with:
67+
pr_number: ${{ github.event.pull_request.number }}
68+
state: ${{ steps.status-check-status.outputs.status }}
69+
repository: Romarionijim/Playwright-TypeScript-Mini-Project
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)