Skip to content

Commit

Permalink
PullRequestにテスト結果をデプロイしたURLをコメントする
Browse files Browse the repository at this point in the history
  • Loading branch information
futabooo committed Dec 15, 2024
1 parent e7d3349 commit 0e4e38f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/playwright-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
timeout-minutes: 10
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

Expand All @@ -33,9 +34,19 @@ jobs:
run: npx playwright test

- name: Deploy Playwright tests report
id: deploy
if: ${{ !cancelled() }}
uses: cloudflare/wrangler-action@6d58852c35a27e6034745c5d0bc373d739014f7f # v3.13.0
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy playwright-report --project-name=notion-bar-colorize

- name: print pages-deployment-alias-url
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
DEPLOYMENT_ALIAS_URL: ${{ steps.deploy.outputs.pages-deployment-alias-url }}
run: |
gh pr comment "${PR_NUMBER}" \
--body "Playwright tests report deployed to [${DEPLOYMENT_ALIAS_URL}](https://${DEPLOYMENT_ALIAS_URL})"

0 comments on commit 0e4e38f

Please sign in to comment.