playwright-report-summary icon indicating copy to clipboard operation
playwright-report-summary copied to clipboard

Input PR id as input parameter

Open awolfson2 opened this issue 1 year ago • 3 comments

Maybe this is already supported, but i'm running a workflow from a slack bot (api triggered). I want to update a PR that was created in a different workflow and comment my playwright results in that PR. I'm using a few other actions and input a pr_id that associates the action with the results. Does your action do this or something similar?

thank you!

awolfson2 avatar Jan 10 '25 13:01 awolfson2

Hi! No, this isn't currently supported, I'm afraid.

It would involve two distinct steps I think:

  1. Get the playwright report data, which would be somewhat difficult from outside the action triggering the tests
  2. Find the current PR and comment on it, which would be the easy part.

I'm currently pretty busy with client work, but if you come up with a PR, I'm happy to take a look!

daun avatar Jan 10 '25 14:01 daun

in my scenario, the report data is in the same triggered action, so i just need to leverage a defined PR id. I tried to submit a branch so i can test, can you give me access to do so?

awolfson2 avatar Jan 10 '25 16:01 awolfson2

@awolfson2 Okay, that sounds doable.

How would I give you access? PRs are open I think, but let me know if it needs anything else!

daun avatar Jan 12 '25 23:01 daun

I have this issue as well, I'm triggering the build on something other that the PR action, so I need a variable I cause use to pass in the PR number.

See https://github.com/thombashi/pytest-md-report/issues/21 for a similar issue, and a way to get the PR with another action, to pass it into a different action that has the same issue.

darmbrust avatar Jul 22 '25 18:07 darmbrust

Nice, that way of using it looks fine. I'm not sure I'll get to it very quickly. Appreciate a helping hand in the form of a PR, otherwise I'll get to it when the client work lets up a bit.

daun avatar Jul 22 '25 18:07 daun

Made an attempt... completely untested though. https://github.com/daun/playwright-report-summary/pull/290

darmbrust avatar Jul 22 '25 19:07 darmbrust

Thanks @darmbrust, this is released as version 3.10. I've renamed the input pr-number for clarity.

This is how it would look for this action:

  - uses: jwalton/gh-find-current-pr@v1
    id: pr
  - uses: daun/playwright-report-summary@v3
    with:
      report-file: results.json
      pr-number: ${{ steps.pr.outputs.number }}

daun avatar Jul 23 '25 19:07 daun

awesome - thanks!

darmbrust avatar Jul 23 '25 19:07 darmbrust