-
Notifications
You must be signed in to change notification settings - Fork 208
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
Update label action #1734
Update label action #1734
Conversation
Code Climate has analyzed commit 118f778 and detected 0 issues on this pull request. View more on Code Climate. |
Codecov Report
@@ Coverage Diff @@
## main #1734 +/- ##
=======================================
Coverage 63.47% 63.47%
=======================================
Files 39 39
Lines 1180 1180
=======================================
Hits 749 749
Misses 431 431 |
OK, first i looked at the error log, it showed this:
Then I updated the action to v2 (v1 was prob from the example) Then i triggered it by adding the label to this PR, and got it to error, restarted the job with debugging enabled: https://github.com/publiclab/mapknitter/runs/6625990189?check_suite_focus=true
|
I think it's probably this line! I wonder... is it not able to work on pull requests? Could it be adapted for pull requests? Hmm. |
OK, I left a clarifying question on the repository for the action! hramos/respond-to-issue-based-on-label#12 |
Hi @jywarren, I tried digging around myself and stumbled to the same conclusion: maybe the bot specifically caters to only issues, no PRs. Here's a similar bot that does roughly the same thing but it's clearly stated in the docs that it handles both PRs, issues, and discussions: dessant/label-actions I went ahead and explored their codebase and noticed that they had to differentiate between issues and PRs when accessing the webhook payload and writing their internal functions here and here. I could be wrong but it appears that if the event is an issue, the payload details coming from Github is contained in the key 'issue'. However, if the event is triggered by a pull request, then the key is 'pull_request' instead. This further confirmed my suspicion that the one we settled on solely focused on issues only. Alas, the all-encompassing bot is not without its own limitations. It has a major roadblock: if the creator of the PR is a bot, then the workflow won't run. At least, that's what I figured from this line in the codebase. That kinda defeats the whole point of our search, as the PRs to be commented on are created by dependabot 😞 Several hours of googling and gazillions of tabs later 😆, I figured we could do it ourselves using GitHub API and GitHub Actions. The latter runs the workflow and the former helps us make the comment ourselves provided the PR is made by dependabot. Tested it out on my forked repo with over 10 PRs made by dependabot and each was auto-commented on as desired. So, I went ahead to make a PR at #1738. Please help review 😄. Thank you! |
Ah, just caught up here. Wow, fantastic and deep work here! I hope it was fulfilling rather than overly frustrating! It's great to see it working. Now we can copy this into plots2! You might be interested at some point in releasing your own Github Action, too! I've never done that! |
Just linking to the working PR where we see the comment now! #1741 (comment) |
Thank you ❤️ @jywarren.....there were hints of frustration here and there but nothing beats the feeling of finally resolving an issue. So, yeah, I'm feeling fulfilled 😄.
Cool! Seems perfect for an FTO. Would we be adding this to only plots2? or all our repos as well?
Wow 😄 ...didn't think about this. Just only entertained the idea of possibly writing about my experience to help others who might have the same issue. But now that you've mentioned it, it's worth taking a shot at. Thank you! |
Oh, I think this links to the wrong comment |
Ah true it's #1741 (comment) -- great. |
Oh and yes, i do think we could make an FTO of this! |
* chore: create workflow for processing label action * Update label-actions.yml * chore: add configuration path
rake test
@publiclab/mapknitter-reviewers
for help, in a comment below