-
Notifications
You must be signed in to change notification settings - Fork 10
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
[FEATURE] Expose a GitHub Action #335
Comments
Sounds good. Lemme sketch this out a little bit. and get back to you. If you have any suggestions for it. lemme know! |
Hey @thejcannon! I was wondering, I could create an action that uses the generator and what not, but it will only generate the files, you will have to add something to the workflow to commit that to the PR say (if is the context you are working on). to summarize: The action could run the I can provide the example in the documentation for sure. Just wondering if that would be "turnkey" ready for you. thanks in advance! |
Sounds perfect, and extensible. I can make a workflow that checks the file matches expected, and one that pushes a generated result that's opt in |
Okay then. I will add the action.yml here, and see how it goes. Ping you when I have something concrete. :) |
Alright, take a look at #337. I've test it and it does the job. my tiny workflow for the test was this: name: Lint
on:
push:
branches:
- main
pull_request:
jobs:
codeowners:
runs-on: ubuntu-latest
needs: getNodeVersion
steps:
- uses: actions/checkout@v2 # to checkout the code of the repo you want to change the CODEOWNERS from.
- name: running codeowners
uses: gagoar/codeowners-generator@gg/action
with:
use-maintainers: true I can add the generate token and commit to the PR for instance. Lemme know if you need more guidance ! |
Yup that looks right on par. Thanks for the speedy resolution 🙌 |
🎉 I will clean things up and add Documentation. Lemme know if you would like to help with the use case you were looking for in the form of Readme! :) |
One helpful feature would be the option to pass a flag to have it report failure when the generator produces a diff - this would make it easier to fail a PR if people have updated codeowners without regenerating. As it is I'm running this action with a following job:
Thanks for the quick work on putting this together! |
I see what you mean. The only issue with putting this in the action is the number of assumptions I will have to do. Particularly assuming someone did a Also, not producing a change in CODEOWNERS is not necessarily a bad thing in many chases. Say you ran it locally, and when is running in the cloud it doesn't find a difference. In any case. I think the best we can do to keep the action agnostic is the following:
I need help naming the option. Any suggestions? |
FWIW You usually see this kinda thing on the tool itself. Usually the code itself is isolated to the step that does the writing (e.g. "fail if check else write"). |
Otherwise probably not worth dirtying the action over, callers can find their own solution (like |
I believe it could be a good idea to have the action as a guard or to use the action to commit the changes if it finds any changes as I've done in some projects. This is useful when a project is not JS-centric. So I can sort of see the use case @thejcannon. |
Oh I'm advocating for the new option in the action. But I'm also adding that it should be an option on the tool itself. To lay all the cards out here:
So we'd be using the action for the checking, because we don't already use JS. But for folks who ARE invoking the tool directly (everyone today, since the action doens't exist yet) |
Thanks for the context! So, you would not want the Adding a check on the cli will be no problem. then making that option available within the action is like the preview one. Confirm that I've understood what you are asking before I start coding :) |
Yes. I mean technically I want both. But being able to control the behavior from an option means I have both. So yeah <3 |
hehe, yea, this gives you both. Without a doubt. alright. Got my marching orders it seems. I will ping you guys back with the PR a bit later this weekend. Thanks for staying on top of the 🧵 |
No, thank you. You're doing the hard work 😉 |
Hey, @thejcannon and @TansyArron. Just to keep you updated, the feature is up for review in #342 As soon as I get someone to review it (hopefully we get the wonderful @gustavkj to 👀 ) I will fast forward with the action, which it will involve adding the option :) |
After a bit of discussion (mainly #335) we narrowed it down into a solution that will simplify the implementation of the action. The functionality `--check` does something very simple: It fails if the existing CODOWNERS file doesn't match the generated one. It will be useful to "lint" if the committed code is in fact matching what it should be. This functionality as said previously will simplify the action given that many developers seem to want just the check and not to generate the update within the workflow (Like I would have thought initially). I will provide documentation, but for now the code is complete and tested (unit test)
Thank you! |
This PR will add the the capability for the project to be an action in GitHub. I will fast follow this PR with a release so I can publish it on the GitHub market. This PR should close #335
Hey @TansyArron @thejcannon I just published the action here 🙏🏻 take a look if can! and try it now from the tag itself ( I've also added some documentation considering 2 use cases: linting (using the check) and committing changes directly to the PR itself. Thanks again! |
Bumping version 2.2.0 That comes with: - Preserve block position [`#347`](#347) - ChatGPT rewrote it [`#349`](#349) - Using swc instead of ts-jest [`#348`](#348) - Update Node.js to v16.19.1 [`#341`](#341) - Update dependency husky to v8.0.3 [`#339`](#339) - adding composite action to use codeowners-generator in a workflow [`#337`](#337) - 2.1.5 [`#346`](#346) - Preserve block position (#347) [`#343`](#343) - adding composite action to use codeowners-generator in a workflow (#337) [`#335`](#335)
Is your feature request related to a problem? Please describe.
As someone who doesn't do much web coding, and so isn't as familiar with the relevant steps to "set up" this tool, I'd love to run this tool in a GHA, witha "turnkey" experience.
Describe the solution you'd like
An easy-to-use configurable GitHub Action.
Describe alternatives you've considered
Gotta roll my own
Additional context
<3
The text was updated successfully, but these errors were encountered: