Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
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
17 changes: 17 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,21 @@ jobs:
path: playwright-report
retention-days: 14

- name: Check repo context
id: context-check
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
if [ "${{ github.event.pull_request.head.repo.full_name }}" = "${{ github.repository }}" ]; then
echo "internal=true" >> $GITHUB_OUTPUT
else
echo "internal=false" >> $GITHUB_OUTPUT
fi
else
echo "internal=true" >> $GITHUB_OUTPUT
fi

- name: Check out reports branch
if: steps.context-check.outputs.internal == 'true'
uses: actions/checkout@v4
with:
ref: test-reports
Expand All @@ -131,13 +145,15 @@ jobs:

- name: Generate report name and URL
id: report-id
if: steps.context-check.outputs.internal == 'true'
run: |
name=$(date +"%Y-%m-%d-%H-%M-%S")
echo "name=$name" >> $GITHUB_OUTPUT
echo "path=reports/$name" >> $GITHUB_OUTPUT
echo "url=https://swup.github.io/swup/reports/$name/" >> $GITHUB_OUTPUT

- name: Copy html report and push reports branch
if: steps.context-check.outputs.internal == 'true'
run: |
mkdir -p test-reports-branch/${{ steps.report-id.outputs.path }}
cp -r playwright-report/. test-reports-branch/${{ steps.report-id.outputs.path }}
Expand All @@ -160,6 +176,7 @@ jobs:
done

- name: Output report url
if: steps.context-check.outputs.internal == 'true'
run: |
echo "::notice title=Published Playwright test report::${{ steps.report-id.outputs.url }}"

Expand Down
Loading