Skip to content

Commit

Permalink
Chore(ci): Create comment with e2e tests report when failuire
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Mar 15, 2024
1 parent 9524164 commit dd8aaa9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,23 @@ jobs:
name: playwright-report
path: playwright-report/
retention-days: 30

- name: Comment PR with artifact URL
if: failure()
uses: actions/github-script@v5
with:
script: |
const artifactName = 'playwright-report';
const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}/artifacts/${artifactName}`;
const issue_number = context.issue.number;
const repo = context.repo.repo;
const owner = context.repo.owner;
await github.rest.issues.createComment({
owner,
repo,
issue_number,
body: `Here is the URL of the uploaded artifact: ${artifactUrl}`
});
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit dd8aaa9

Please sign in to comment.