legesher / tree-sitter-legesher-python

✨ Legesher's Python grammar for Tree-Sitter 🌳
https://www.legesher.io
Other
45 stars 37 forks source link

feat: add Github Actions for fork repo updates #11

Closed madiedgar closed 4 years ago

madiedgar commented 4 years ago

Github Actions for tree-sitter-python updates

Would love to implement Github Actions to automate some of our workflow. Eventually incorporating that into future builds for CI / CD pipeline.

This repository is forked from Tree-Sitter's tree-sitter-python. Would love to set up a GitHub action that does the following:

wescran commented 4 years ago

Hello again! I'm new to GitHub Actions but am willing to take a shot at this.

madiedgar commented 4 years ago

That would be amazing @wescran! Thanks for being willing to get your feet wet with new things! πŸ˜„ I'll update this issue with some more thoughts as to what might be helpful, and please feel free to add what you find as well! Excited to utilize this feature!

madiedgar commented 4 years ago

Hey @wescran, I updated the issue description with a little more insight into what this Github Action might do. Let me know if you have any questions πŸ˜„

wescran commented 4 years ago

Awesome, thanks for the update! I will get started on this

wescran commented 4 years ago

@madiedgar I have a question after doing some research on this topic.

Workflows can be triggered from a push event but I'm not sure how to trigger the workflow from a push on a repository outside of the one the workflow is in. Maybe I have missed something in the docs. Would you be able to help with that/provide a hint?

I was also looking into webhooks and those could be used to monitor a repository but you need to have permission from the repo owner for that.

I found a published action that is able to create a labelled GitHub issue from a template so once I figure out how to listen to tree-sitter-python I should be able to write the workflow.

Thanks for your help :)

madiedgar commented 4 years ago

Hey @wescran πŸ‘‹! Happy to provide some context:

Workflows can be triggered from a push event but I'm not sure how to trigger the workflow from a push on a repository outside of the one the workflow is in. Maybe I have missed something in the docs. Would you be able to help with that/provide a hint?

This was definitely a want not a need, as I'm still learning what all GitHub actions can be utilized for. Trying to trigger push events from another repository would be the way I would approach it, but if Actions doesn't support that we may need to explore another solution. πŸ˜„ Is it the same for releases as well?

Thanks for looking into that! I'll look more into the documentation / reach out to tree-sitter-python's repo owner to see if we could get permission to create a webhook for this. πŸ‘

wescran commented 4 years ago

@madiedgar Yes I believe all the event triggers only work on the repository the workflow is in. I was looking into the GitHub api and there might be potential in querying the commits or releases for tree-sitter-python. I can experiment with that and get back to you

wescran commented 4 years ago

Hey @madiedgar, just an update from over the weekend. So I managed to get started on making my own action. It basically queries a defined public repo using the GutHub API for commits. Once it finds one then it makes an issue on another repo. The issue has the desired labels and the body has links to the commits it finds. I have it running as a scheduled workflow which will run every hour to check for commits over the past hour. I think this will work as you have requested, I just need to spend an evening testing this. Then I can make a PR once I'm confident in it working. Hopefully I will have this done by the end of the week :)

madiedgar commented 4 years ago

Wow, great work @wescran! Thanks so much for tackling this!!

wescran commented 4 years ago

Hey @madiedgar I didn't realize I had to sign up for Github Actions. I am still waiting to join the beta so that I can start using them. Until then I don't think I can test what I have built. Sorry for the delay

madiedgar commented 4 years ago

No worries @wescran! Thanks for working on that. Is there a way that I can help in getting you access to GitHub Actions?

wescran commented 4 years ago

Hey @madiedgar I was able to get access to GitHub Actions. I am currently running tests now and will bring the changes over to your repo once I'm confident it is working properly.

madiedgar commented 4 years ago

That's amazing!!! Can't wait to see it! πŸ˜„

madiedgar commented 4 years ago

Closing this issue as you resolved it in #22

lock[bot] commented 4 years ago

⚠️This issue has been automatically locked πŸ”’since there has not been any recent activity after it was closed. Please open a new πŸ†•issue for related bugs and mention this issue. Thanks! πŸ‘