Skip to content

Commit 1f6d0ee

Browse files
committed
fix: deploy report per path prefix so View Full Report links to correct run
1 parent d03d862 commit 1f6d0ee

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

.github/workflows/qa-run.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,28 @@ jobs:
6868
env:
6969
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7070
run: |
71-
cd tools/qa/playwright-report
72-
git init
71+
REPO_URL="https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git"
72+
PAGES_DIR="/tmp/gh-pages"
73+
git clone --depth 1 --branch gh-pages "$REPO_URL" "$PAGES_DIR" 2>/dev/null || (
74+
mkdir -p "$PAGES_DIR" && cd "$PAGES_DIR" && git init && git checkout -b gh-pages
75+
)
76+
rm -rf "${PAGES_DIR}${{ inputs.path_prefix }}"
77+
mkdir -p "${PAGES_DIR}${{ inputs.path_prefix }}"
78+
cp -r tools/qa/playwright-report/. "${PAGES_DIR}${{ inputs.path_prefix }}/"
79+
cd "$PAGES_DIR"
7380
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
7481
git config user.name "github-actions[bot]"
7582
git add .
76-
git commit -m "deploy playwright report [skip ci]"
77-
git push --force "https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git" HEAD:gh-pages
83+
git diff --staged --quiet || git commit -m "deploy report for ${{ inputs.path_prefix }} [skip ci]"
84+
git push "$REPO_URL" gh-pages
7885
7986
- name: Write summary
8087
working-directory: tools/qa
8188
env:
8289
PATH_PREFIX: ${{ inputs.path_prefix }}
8390
DIFF_THRESHOLD: ${{ inputs.threshold }}
8491
SUITE: ${{ inputs.suite }}
85-
REPORT_URL: https://adobedocs.github.io/adp-devsite-github-actions-test/
92+
REPORT_URL: https://adobedocs.github.io/adp-devsite-github-actions-test${{ inputs.path_prefix }}/
8693
run: node summarize.js
8794

8895
- name: Commit results

0 commit comments

Comments
 (0)