-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The app doesn't leave a message when the workflow is triggered via comment #187
Comments
As you can see here: pkg.pr.new/packages/backend/server/routes/webhook.post.ts Lines 74 to 75 in 6ba34b5
The github app listens for pull request events! Did you send that PR after installing the app or before installing the app? If it's the latter, then you may want to close and re-open a PR. Let me know what do you think. |
if not, I can debug this and find the root cause. |
I tried to open a new PR for test, and it didn't work as expected. Test PR: withastro/astro#11807 (you can ignore the comment from the github actions bot) |
I am trying to guess; maybe that's the issue? The workflow was triggered by a comment that was created in a PR. Or maybe I don't know the code enough 😆 |
Nicee, yea that might be an issue, I'll debug soon! Thank you so much meanwhile you may want to fallback to publishing on each change? So you won't be blocked by me, let me know what can I do, would be happy to help. |
@ematipico What do you think about the vuetifyjs/nuxt-module way? https://github.com/vuetifyjs/nuxt-module/pulls?q=is%3Apr+is%3Aclosed Maybe you can use their pattern of using comments. |
That wouldn't work for us, because we want to publish multiple previews in the same PR, but we don't want to do it at every commit to not waste CI time. Is there some kind of limitation? |
Hmm, I see, no as far as I see there's no limitation here but I wanted to have you on boarded on a solution meanwhile I look this up! |
Ok, after my research, I believe there's a limitation! Workflows for issue_comments (and related events) do not give info on the pull request, but instead, it assumes the run is on the default branch (main). That's why as you can see in your workflows, it targets a commit that is in the main history and not in that PR history. And since there's no PR for the main branch, it does not comment anything :) So not commenting is an expected behavior, and the content of the published packages is not correct too since it comes from the main branch and not the updated PR. And since pkg.pr.new relies on github events and their information, it cannot do something for this case (it might be able though, but I think that'd require so many hacks) since we get the same info! What I believe can be done is what you're already doing.
But that'd enable next workflows without a comment since the label is there. Maybe you can do this:
This would make the continuous releases need a comment for each preview and hopefully achieve the desired behavior. Adding this to the next step: - run: |
gh issue edit ${{ github.event.issue.number }} --remove-label "pr: preview" --repo ${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} And for comments, maybe you can use this option in pkg-pr-new. Related: #200 by @AriPerkkio since it has the same issue with |
Yep exactly -
In #200 there's a work-around mentioned for this:
@Aslemammad I just remembered that I have built a custom Github Action that does exactly this. It listens for comments on PR, then checks out to that branch, runs some code and finally posts results to that PR as comment. Sources are available here: https://github.com/AriPerkkio/eslint-remote-tester-compare-action/blob/master/src/index.ts#L18 |
That works but it does not affect the events that the github webhook sends us, which is what we rely on! Same with the action! The issues (it's not an issue from Github's side 😅) lies in the fact that we do not get the information we get from pull request events in issue_comment events. And the information issue_comment gives in a workflow run event in the webhook is all around the default branch. |
The
pkg.pr.new
works fine, and the workflow is triggered correctly when usingpull_request
.However, when I changed it, it wouldn't leave a comment to the PR anymore. Particularly, I used this trigger event:
The workflow is triggered correctly and
pkg.pr.new
worked: https://github.com/withastro/astro/actions/runs/10490295437However the GithHub application didn't leave any comment. Is it expected or a bug?
The text was updated successfully, but these errors were encountered: