oxsecurity / megalinter

🦙 MegaLinter analyzes 50 languages, 22 formats, 21 tooling formats, excessive copy-pastes, spelling mistakes and security issues in your repository sources with a GitHub Action, other CI tools or locally.
https://megalinter.io
GNU Affero General Public License v3.0
1.93k stars 237 forks source link

Create a PR bot to run our `./build.sh` command [help wanted] #2351

Closed echoix closed 1 year ago

echoix commented 1 year ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] Making quick contributions can be hard for new users, or even maintainers, since we need to have a full (Linux) setup ready to run an update command to sync up the Dockerfiles (which is not that common for projects).

Describe the solution you'd like A clear and concise description of what you want to happen. In some big repos over time, I often saw slack-like bots that you can post a command and it does tasks for you. It would be nice to have a bot like this, so we could simply enter a comment with a single command saying to update the PR/sync the files by running our ./build.sh command (on Linux), with the dependencies already defined in the task, and commit the new files to that PR.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

During the last week, I tried to search for what tools like this exist, and I must not have used the good keywords, but didn't really find useful stuff in my quick searches.

Additional context Add any other context or screenshots about the feature request here.

If anybody has some experience with tools like this and have opinions, or could guide us, or better, help us with a PR, it could be helpful here to reduce friction!

nvuillam commented 1 year ago

You mean a bot that will create new commits directly in forks ? Such thing exist ? :)

echoix commented 1 year ago

Oh yah, I didn't think about the fork thing.

nvuillam commented 1 year ago

Most of the PRs are from forks , the internal contributor already know the drill ^^

echoix commented 1 year ago

I was thinking about that: image or (I can'T refind what I was looking for) but now I see it didn't need to commit when working...

That must be why it wasn't obvious to search for

echoix commented 1 year ago

I think I found something: https://github.com/peter-evans/slash-command-dispatch

nvuillam commented 1 year ago

It seems to trigger pipelines... but will it be able to add commits on forks ^^

echoix commented 1 year ago

I'm checking that...

echoix commented 1 year ago

I'm almost there. It "works" for the building part, I only need to finish fixing one thing to make the workflow not fail (I just didn't have any time left), and after that making the comment that is pasted cleaner. It's kind of nice actually

https://github.com/echoix/megalinter/actions/runs/4154228174

bdovaz commented 1 year ago

I would add the build.sh --doc case for documentation, no?

nvuillam commented 1 year ago

Using --doc generate many conflicts, I prefer letting auto-update-linter job being the only one doing it :) (except us manually in some aases)

echoix commented 1 year ago

Ok, when you would want to use it manually, would you like to type it as /build doc or /docs (ie: as a variable argument or as a complete different command)

For now the plain build.sh changes the md docs for the linters.